Left Termination of the query pattern mergesort_in_3(g, a, a) w.r.t. the given Prolog program could successfully be proven:



Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof

Clauses:

mergesort([], [], Ls).
mergesort(.(X, []), .(X, []), Ls).
mergesort(.(X, .(Y, Xs)), Ys, .(H, Ls)) :- ','(split(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)), ','(mergesort(X1s, Y1s, Ls), ','(mergesort(X2s, Y2s, Ls), merge(Y1s, Y2s, Ys, .(H, Ls))))).
split([], [], [], Ls).
split(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) :- split(Xs, Zs, Ys, Ls).
merge([], Xs, Xs, Ls).
merge(Xs, [], Xs, Ls).
merge(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) :- ','(le(X, Y), merge(Xs, .(Y, Ys), Zs, Ls)).
merge(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) :- ','(gt(X, Y), merge(.(X, Xs), Ys, Zs, Ls)).
gt(s(X), s(Y)) :- gt(X, Y).
gt(s(0), 0).
le(s(X), s(Y)) :- le(X, Y).
le(0, s(0)).
le(0, 0).

Queries:

mergesort(g,a,a).

We use the technique of [30]. With regard to the inferred argument filtering the predicates were used in the following modes:
mergesort_in: (b,f,f)
split_in: (b,f,f,f)
merge_in: (b,b,f,f)
le_in: (b,b)
gt_in: (b,b)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

mergesort_in_gaa([], [], Ls) → mergesort_out_gaa([], [], Ls)
mergesort_in_gaa(.(X, []), .(X, []), Ls) → mergesort_out_gaa(.(X, []), .(X, []), Ls)
mergesort_in_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_gaa(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
split_in_gaaa([], [], [], Ls) → split_out_gaaa([], [], [], Ls)
split_in_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_out_gaaa(Xs, Zs, Ys, Ls)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls))
U1_gaa(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_gaa(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
merge_in_ggaa([], Xs, Xs, Ls) → merge_out_ggaa([], Xs, Xs, Ls)
merge_in_ggaa(Xs, [], Xs, Ls) → merge_out_ggaa(Xs, [], Xs, Ls)
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(0)) → le_out_gg(0, s(0))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(.(X, Xs), Ys, Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls))
U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(Xs, .(Y, Ys), Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls))
U4_gaa(X, Y, Xs, Ys, H, Ls, merge_out_ggaa(Y1s, Y2s, Ys, .(H, Ls))) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls))

The argument filtering Pi contains the following mapping:
mergesort_in_gaa(x1, x2, x3)  =  mergesort_in_gaa(x1)
[]  =  []
mergesort_out_gaa(x1, x2, x3)  =  mergesort_out_gaa(x2)
.(x1, x2)  =  .(x1, x2)
U1_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U1_gaa(x7)
split_in_gaaa(x1, x2, x3, x4)  =  split_in_gaaa(x1)
split_out_gaaa(x1, x2, x3, x4)  =  split_out_gaaa(x2, x3)
U5_gaaa(x1, x2, x3, x4, x5, x6, x7)  =  U5_gaaa(x1, x7)
U2_gaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U2_gaa(x7, x8)
U3_gaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U3_gaa(x7, x8)
U4_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U4_gaa(x7)
merge_in_ggaa(x1, x2, x3, x4)  =  merge_in_ggaa(x1, x2)
merge_out_ggaa(x1, x2, x3, x4)  =  merge_out_ggaa(x3)
U6_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U6_ggaa(x1, x2, x3, x4, x8)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U7_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_ggaa(x1, x8)
U8_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U8_ggaa(x1, x2, x3, x4, x8)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U9_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U9_ggaa(x3, x8)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof
  ↳ PrologToPiTRSProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

mergesort_in_gaa([], [], Ls) → mergesort_out_gaa([], [], Ls)
mergesort_in_gaa(.(X, []), .(X, []), Ls) → mergesort_out_gaa(.(X, []), .(X, []), Ls)
mergesort_in_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_gaa(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
split_in_gaaa([], [], [], Ls) → split_out_gaaa([], [], [], Ls)
split_in_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_out_gaaa(Xs, Zs, Ys, Ls)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls))
U1_gaa(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_gaa(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
merge_in_ggaa([], Xs, Xs, Ls) → merge_out_ggaa([], Xs, Xs, Ls)
merge_in_ggaa(Xs, [], Xs, Ls) → merge_out_ggaa(Xs, [], Xs, Ls)
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(0)) → le_out_gg(0, s(0))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(.(X, Xs), Ys, Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls))
U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(Xs, .(Y, Ys), Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls))
U4_gaa(X, Y, Xs, Ys, H, Ls, merge_out_ggaa(Y1s, Y2s, Ys, .(H, Ls))) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls))

The argument filtering Pi contains the following mapping:
mergesort_in_gaa(x1, x2, x3)  =  mergesort_in_gaa(x1)
[]  =  []
mergesort_out_gaa(x1, x2, x3)  =  mergesort_out_gaa(x2)
.(x1, x2)  =  .(x1, x2)
U1_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U1_gaa(x7)
split_in_gaaa(x1, x2, x3, x4)  =  split_in_gaaa(x1)
split_out_gaaa(x1, x2, x3, x4)  =  split_out_gaaa(x2, x3)
U5_gaaa(x1, x2, x3, x4, x5, x6, x7)  =  U5_gaaa(x1, x7)
U2_gaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U2_gaa(x7, x8)
U3_gaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U3_gaa(x7, x8)
U4_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U4_gaa(x7)
merge_in_ggaa(x1, x2, x3, x4)  =  merge_in_ggaa(x1, x2)
merge_out_ggaa(x1, x2, x3, x4)  =  merge_out_ggaa(x3)
U6_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U6_ggaa(x1, x2, x3, x4, x8)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U7_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_ggaa(x1, x8)
U8_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U8_ggaa(x1, x2, x3, x4, x8)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U9_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U9_ggaa(x3, x8)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

MERGESORT_IN_GAA(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_GAA(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
MERGESORT_IN_GAA(.(X, .(Y, Xs)), Ys, .(H, Ls)) → SPLIT_IN_GAAA(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))
SPLIT_IN_GAAA(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_GAAA(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
SPLIT_IN_GAAA(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → SPLIT_IN_GAAA(Xs, Zs, Ys, Ls)
U1_GAA(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_GAA(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U1_GAA(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → MERGESORT_IN_GAA(X1s, Y1s, Ls)
U2_GAA(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_GAA(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U2_GAA(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → MERGESORT_IN_GAA(X2s, Y2s, Ls)
U3_GAA(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_GAA(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
U3_GAA(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → MERGE_IN_GGAA(Y1s, Y2s, Ys, .(H, Ls))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_in_gg(X, Y))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → LE_IN_GG(X, Y)
LE_IN_GG(s(X), s(Y)) → U11_GG(X, Y, le_in_gg(X, Y))
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
U6_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_GGAA(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
U6_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → MERGE_IN_GGAA(Xs, .(Y, Ys), Zs, Ls)
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_in_gg(X, Y))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → GT_IN_GG(X, Y)
GT_IN_GG(s(X), s(Y)) → U10_GG(X, Y, gt_in_gg(X, Y))
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
U8_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_GGAA(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U8_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → MERGE_IN_GGAA(.(X, Xs), Ys, Zs, Ls)

The TRS R consists of the following rules:

mergesort_in_gaa([], [], Ls) → mergesort_out_gaa([], [], Ls)
mergesort_in_gaa(.(X, []), .(X, []), Ls) → mergesort_out_gaa(.(X, []), .(X, []), Ls)
mergesort_in_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_gaa(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
split_in_gaaa([], [], [], Ls) → split_out_gaaa([], [], [], Ls)
split_in_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_out_gaaa(Xs, Zs, Ys, Ls)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls))
U1_gaa(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_gaa(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
merge_in_ggaa([], Xs, Xs, Ls) → merge_out_ggaa([], Xs, Xs, Ls)
merge_in_ggaa(Xs, [], Xs, Ls) → merge_out_ggaa(Xs, [], Xs, Ls)
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(0)) → le_out_gg(0, s(0))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(.(X, Xs), Ys, Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls))
U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(Xs, .(Y, Ys), Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls))
U4_gaa(X, Y, Xs, Ys, H, Ls, merge_out_ggaa(Y1s, Y2s, Ys, .(H, Ls))) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls))

The argument filtering Pi contains the following mapping:
mergesort_in_gaa(x1, x2, x3)  =  mergesort_in_gaa(x1)
[]  =  []
mergesort_out_gaa(x1, x2, x3)  =  mergesort_out_gaa(x2)
.(x1, x2)  =  .(x1, x2)
U1_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U1_gaa(x7)
split_in_gaaa(x1, x2, x3, x4)  =  split_in_gaaa(x1)
split_out_gaaa(x1, x2, x3, x4)  =  split_out_gaaa(x2, x3)
U5_gaaa(x1, x2, x3, x4, x5, x6, x7)  =  U5_gaaa(x1, x7)
U2_gaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U2_gaa(x7, x8)
U3_gaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U3_gaa(x7, x8)
U4_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U4_gaa(x7)
merge_in_ggaa(x1, x2, x3, x4)  =  merge_in_ggaa(x1, x2)
merge_out_ggaa(x1, x2, x3, x4)  =  merge_out_ggaa(x3)
U6_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U6_ggaa(x1, x2, x3, x4, x8)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U7_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_ggaa(x1, x8)
U8_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U8_ggaa(x1, x2, x3, x4, x8)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U9_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U9_ggaa(x3, x8)
MERGE_IN_GGAA(x1, x2, x3, x4)  =  MERGE_IN_GGAA(x1, x2)
LE_IN_GG(x1, x2)  =  LE_IN_GG(x1, x2)
U6_GGAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U6_GGAA(x1, x2, x3, x4, x8)
U2_GAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U2_GAA(x7, x8)
U1_GAA(x1, x2, x3, x4, x5, x6, x7)  =  U1_GAA(x7)
SPLIT_IN_GAAA(x1, x2, x3, x4)  =  SPLIT_IN_GAAA(x1)
U3_GAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U3_GAA(x7, x8)
U7_GGAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_GGAA(x1, x8)
U9_GGAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U9_GGAA(x3, x8)
U10_GG(x1, x2, x3)  =  U10_GG(x3)
MERGESORT_IN_GAA(x1, x2, x3)  =  MERGESORT_IN_GAA(x1)
U5_GAAA(x1, x2, x3, x4, x5, x6, x7)  =  U5_GAAA(x1, x7)
U11_GG(x1, x2, x3)  =  U11_GG(x3)
U8_GGAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U8_GGAA(x1, x2, x3, x4, x8)
GT_IN_GG(x1, x2)  =  GT_IN_GG(x1, x2)
U4_GAA(x1, x2, x3, x4, x5, x6, x7)  =  U4_GAA(x7)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

MERGESORT_IN_GAA(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_GAA(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
MERGESORT_IN_GAA(.(X, .(Y, Xs)), Ys, .(H, Ls)) → SPLIT_IN_GAAA(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))
SPLIT_IN_GAAA(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_GAAA(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
SPLIT_IN_GAAA(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → SPLIT_IN_GAAA(Xs, Zs, Ys, Ls)
U1_GAA(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_GAA(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U1_GAA(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → MERGESORT_IN_GAA(X1s, Y1s, Ls)
U2_GAA(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_GAA(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U2_GAA(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → MERGESORT_IN_GAA(X2s, Y2s, Ls)
U3_GAA(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_GAA(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
U3_GAA(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → MERGE_IN_GGAA(Y1s, Y2s, Ys, .(H, Ls))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_in_gg(X, Y))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → LE_IN_GG(X, Y)
LE_IN_GG(s(X), s(Y)) → U11_GG(X, Y, le_in_gg(X, Y))
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
U6_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_GGAA(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
U6_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → MERGE_IN_GGAA(Xs, .(Y, Ys), Zs, Ls)
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_in_gg(X, Y))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → GT_IN_GG(X, Y)
GT_IN_GG(s(X), s(Y)) → U10_GG(X, Y, gt_in_gg(X, Y))
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
U8_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_GGAA(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U8_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → MERGE_IN_GGAA(.(X, Xs), Ys, Zs, Ls)

The TRS R consists of the following rules:

mergesort_in_gaa([], [], Ls) → mergesort_out_gaa([], [], Ls)
mergesort_in_gaa(.(X, []), .(X, []), Ls) → mergesort_out_gaa(.(X, []), .(X, []), Ls)
mergesort_in_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_gaa(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
split_in_gaaa([], [], [], Ls) → split_out_gaaa([], [], [], Ls)
split_in_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_out_gaaa(Xs, Zs, Ys, Ls)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls))
U1_gaa(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_gaa(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
merge_in_ggaa([], Xs, Xs, Ls) → merge_out_ggaa([], Xs, Xs, Ls)
merge_in_ggaa(Xs, [], Xs, Ls) → merge_out_ggaa(Xs, [], Xs, Ls)
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(0)) → le_out_gg(0, s(0))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(.(X, Xs), Ys, Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls))
U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(Xs, .(Y, Ys), Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls))
U4_gaa(X, Y, Xs, Ys, H, Ls, merge_out_ggaa(Y1s, Y2s, Ys, .(H, Ls))) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls))

The argument filtering Pi contains the following mapping:
mergesort_in_gaa(x1, x2, x3)  =  mergesort_in_gaa(x1)
[]  =  []
mergesort_out_gaa(x1, x2, x3)  =  mergesort_out_gaa(x2)
.(x1, x2)  =  .(x1, x2)
U1_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U1_gaa(x7)
split_in_gaaa(x1, x2, x3, x4)  =  split_in_gaaa(x1)
split_out_gaaa(x1, x2, x3, x4)  =  split_out_gaaa(x2, x3)
U5_gaaa(x1, x2, x3, x4, x5, x6, x7)  =  U5_gaaa(x1, x7)
U2_gaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U2_gaa(x7, x8)
U3_gaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U3_gaa(x7, x8)
U4_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U4_gaa(x7)
merge_in_ggaa(x1, x2, x3, x4)  =  merge_in_ggaa(x1, x2)
merge_out_ggaa(x1, x2, x3, x4)  =  merge_out_ggaa(x3)
U6_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U6_ggaa(x1, x2, x3, x4, x8)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U7_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_ggaa(x1, x8)
U8_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U8_ggaa(x1, x2, x3, x4, x8)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U9_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U9_ggaa(x3, x8)
MERGE_IN_GGAA(x1, x2, x3, x4)  =  MERGE_IN_GGAA(x1, x2)
LE_IN_GG(x1, x2)  =  LE_IN_GG(x1, x2)
U6_GGAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U6_GGAA(x1, x2, x3, x4, x8)
U2_GAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U2_GAA(x7, x8)
U1_GAA(x1, x2, x3, x4, x5, x6, x7)  =  U1_GAA(x7)
SPLIT_IN_GAAA(x1, x2, x3, x4)  =  SPLIT_IN_GAAA(x1)
U3_GAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U3_GAA(x7, x8)
U7_GGAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_GGAA(x1, x8)
U9_GGAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U9_GGAA(x3, x8)
U10_GG(x1, x2, x3)  =  U10_GG(x3)
MERGESORT_IN_GAA(x1, x2, x3)  =  MERGESORT_IN_GAA(x1)
U5_GAAA(x1, x2, x3, x4, x5, x6, x7)  =  U5_GAAA(x1, x7)
U11_GG(x1, x2, x3)  =  U11_GG(x3)
U8_GGAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U8_GGAA(x1, x2, x3, x4, x8)
GT_IN_GG(x1, x2)  =  GT_IN_GG(x1, x2)
U4_GAA(x1, x2, x3, x4, x5, x6, x7)  =  U4_GAA(x7)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 5 SCCs with 11 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)

The TRS R consists of the following rules:

mergesort_in_gaa([], [], Ls) → mergesort_out_gaa([], [], Ls)
mergesort_in_gaa(.(X, []), .(X, []), Ls) → mergesort_out_gaa(.(X, []), .(X, []), Ls)
mergesort_in_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_gaa(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
split_in_gaaa([], [], [], Ls) → split_out_gaaa([], [], [], Ls)
split_in_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_out_gaaa(Xs, Zs, Ys, Ls)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls))
U1_gaa(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_gaa(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
merge_in_ggaa([], Xs, Xs, Ls) → merge_out_ggaa([], Xs, Xs, Ls)
merge_in_ggaa(Xs, [], Xs, Ls) → merge_out_ggaa(Xs, [], Xs, Ls)
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(0)) → le_out_gg(0, s(0))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(.(X, Xs), Ys, Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls))
U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(Xs, .(Y, Ys), Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls))
U4_gaa(X, Y, Xs, Ys, H, Ls, merge_out_ggaa(Y1s, Y2s, Ys, .(H, Ls))) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls))

The argument filtering Pi contains the following mapping:
mergesort_in_gaa(x1, x2, x3)  =  mergesort_in_gaa(x1)
[]  =  []
mergesort_out_gaa(x1, x2, x3)  =  mergesort_out_gaa(x2)
.(x1, x2)  =  .(x1, x2)
U1_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U1_gaa(x7)
split_in_gaaa(x1, x2, x3, x4)  =  split_in_gaaa(x1)
split_out_gaaa(x1, x2, x3, x4)  =  split_out_gaaa(x2, x3)
U5_gaaa(x1, x2, x3, x4, x5, x6, x7)  =  U5_gaaa(x1, x7)
U2_gaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U2_gaa(x7, x8)
U3_gaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U3_gaa(x7, x8)
U4_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U4_gaa(x7)
merge_in_ggaa(x1, x2, x3, x4)  =  merge_in_ggaa(x1, x2)
merge_out_ggaa(x1, x2, x3, x4)  =  merge_out_ggaa(x3)
U6_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U6_ggaa(x1, x2, x3, x4, x8)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U7_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_ggaa(x1, x8)
U8_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U8_ggaa(x1, x2, x3, x4, x8)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U9_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U9_ggaa(x3, x8)
GT_IN_GG(x1, x2)  =  GT_IN_GG(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)

The TRS R consists of the following rules:

mergesort_in_gaa([], [], Ls) → mergesort_out_gaa([], [], Ls)
mergesort_in_gaa(.(X, []), .(X, []), Ls) → mergesort_out_gaa(.(X, []), .(X, []), Ls)
mergesort_in_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_gaa(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
split_in_gaaa([], [], [], Ls) → split_out_gaaa([], [], [], Ls)
split_in_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_out_gaaa(Xs, Zs, Ys, Ls)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls))
U1_gaa(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_gaa(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
merge_in_ggaa([], Xs, Xs, Ls) → merge_out_ggaa([], Xs, Xs, Ls)
merge_in_ggaa(Xs, [], Xs, Ls) → merge_out_ggaa(Xs, [], Xs, Ls)
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(0)) → le_out_gg(0, s(0))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(.(X, Xs), Ys, Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls))
U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(Xs, .(Y, Ys), Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls))
U4_gaa(X, Y, Xs, Ys, H, Ls, merge_out_ggaa(Y1s, Y2s, Ys, .(H, Ls))) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls))

The argument filtering Pi contains the following mapping:
mergesort_in_gaa(x1, x2, x3)  =  mergesort_in_gaa(x1)
[]  =  []
mergesort_out_gaa(x1, x2, x3)  =  mergesort_out_gaa(x2)
.(x1, x2)  =  .(x1, x2)
U1_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U1_gaa(x7)
split_in_gaaa(x1, x2, x3, x4)  =  split_in_gaaa(x1)
split_out_gaaa(x1, x2, x3, x4)  =  split_out_gaaa(x2, x3)
U5_gaaa(x1, x2, x3, x4, x5, x6, x7)  =  U5_gaaa(x1, x7)
U2_gaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U2_gaa(x7, x8)
U3_gaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U3_gaa(x7, x8)
U4_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U4_gaa(x7)
merge_in_ggaa(x1, x2, x3, x4)  =  merge_in_ggaa(x1, x2)
merge_out_ggaa(x1, x2, x3, x4)  =  merge_out_ggaa(x3)
U6_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U6_ggaa(x1, x2, x3, x4, x8)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U7_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_ggaa(x1, x8)
U8_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U8_ggaa(x1, x2, x3, x4, x8)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U9_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U9_ggaa(x3, x8)
LE_IN_GG(x1, x2)  =  LE_IN_GG(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

U8_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → MERGE_IN_GGAA(.(X, Xs), Ys, Zs, Ls)
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_in_gg(X, Y))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_in_gg(X, Y))
U6_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → MERGE_IN_GGAA(Xs, .(Y, Ys), Zs, Ls)

The TRS R consists of the following rules:

mergesort_in_gaa([], [], Ls) → mergesort_out_gaa([], [], Ls)
mergesort_in_gaa(.(X, []), .(X, []), Ls) → mergesort_out_gaa(.(X, []), .(X, []), Ls)
mergesort_in_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_gaa(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
split_in_gaaa([], [], [], Ls) → split_out_gaaa([], [], [], Ls)
split_in_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_out_gaaa(Xs, Zs, Ys, Ls)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls))
U1_gaa(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_gaa(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
merge_in_ggaa([], Xs, Xs, Ls) → merge_out_ggaa([], Xs, Xs, Ls)
merge_in_ggaa(Xs, [], Xs, Ls) → merge_out_ggaa(Xs, [], Xs, Ls)
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(0)) → le_out_gg(0, s(0))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(.(X, Xs), Ys, Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls))
U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(Xs, .(Y, Ys), Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls))
U4_gaa(X, Y, Xs, Ys, H, Ls, merge_out_ggaa(Y1s, Y2s, Ys, .(H, Ls))) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls))

The argument filtering Pi contains the following mapping:
mergesort_in_gaa(x1, x2, x3)  =  mergesort_in_gaa(x1)
[]  =  []
mergesort_out_gaa(x1, x2, x3)  =  mergesort_out_gaa(x2)
.(x1, x2)  =  .(x1, x2)
U1_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U1_gaa(x7)
split_in_gaaa(x1, x2, x3, x4)  =  split_in_gaaa(x1)
split_out_gaaa(x1, x2, x3, x4)  =  split_out_gaaa(x2, x3)
U5_gaaa(x1, x2, x3, x4, x5, x6, x7)  =  U5_gaaa(x1, x7)
U2_gaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U2_gaa(x7, x8)
U3_gaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U3_gaa(x7, x8)
U4_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U4_gaa(x7)
merge_in_ggaa(x1, x2, x3, x4)  =  merge_in_ggaa(x1, x2)
merge_out_ggaa(x1, x2, x3, x4)  =  merge_out_ggaa(x3)
U6_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U6_ggaa(x1, x2, x3, x4, x8)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U7_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_ggaa(x1, x8)
U8_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U8_ggaa(x1, x2, x3, x4, x8)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U9_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U9_ggaa(x3, x8)
MERGE_IN_GGAA(x1, x2, x3, x4)  =  MERGE_IN_GGAA(x1, x2)
U6_GGAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U6_GGAA(x1, x2, x3, x4, x8)
U8_GGAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U8_GGAA(x1, x2, x3, x4, x8)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

U8_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → MERGE_IN_GGAA(.(X, Xs), Ys, Zs, Ls)
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_in_gg(X, Y))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_in_gg(X, Y))
U6_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → MERGE_IN_GGAA(Xs, .(Y, Ys), Zs, Ls)

The TRS R consists of the following rules:

le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(0)) → le_out_gg(0, s(0))
le_in_gg(0, 0) → le_out_gg(0, 0)
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(0), 0) → gt_out_gg(s(0), 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
MERGE_IN_GGAA(x1, x2, x3, x4)  =  MERGE_IN_GGAA(x1, x2)
U6_GGAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U6_GGAA(x1, x2, x3, x4, x8)
U8_GGAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U8_GGAA(x1, x2, x3, x4, x8)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPOrderProof
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

MERGE_IN_GGAA(.(X, Xs), .(Y, Ys)) → U8_GGAA(X, Xs, Y, Ys, gt_in_gg(X, Y))
U6_GGAA(X, Xs, Y, Ys, le_out_gg) → MERGE_IN_GGAA(Xs, .(Y, Ys))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys)) → U6_GGAA(X, Xs, Y, Ys, le_in_gg(X, Y))
U8_GGAA(X, Xs, Y, Ys, gt_out_gg) → MERGE_IN_GGAA(.(X, Xs), Ys)

The TRS R consists of the following rules:

le_in_gg(s(X), s(Y)) → U11_gg(le_in_gg(X, Y))
le_in_gg(0, s(0)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
gt_in_gg(s(X), s(Y)) → U10_gg(gt_in_gg(X, Y))
gt_in_gg(s(0), 0) → gt_out_gg
U11_gg(le_out_gg) → le_out_gg
U10_gg(gt_out_gg) → gt_out_gg

The set Q consists of the following terms:

le_in_gg(x0, x1)
gt_in_gg(x0, x1)
U11_gg(x0)
U10_gg(x0)

We have to consider all (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


U8_GGAA(X, Xs, Y, Ys, gt_out_gg) → MERGE_IN_GGAA(.(X, Xs), Ys)
The remaining pairs can at least be oriented weakly.

MERGE_IN_GGAA(.(X, Xs), .(Y, Ys)) → U8_GGAA(X, Xs, Y, Ys, gt_in_gg(X, Y))
U6_GGAA(X, Xs, Y, Ys, le_out_gg) → MERGE_IN_GGAA(Xs, .(Y, Ys))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys)) → U6_GGAA(X, Xs, Y, Ys, le_in_gg(X, Y))
Used ordering: Combined order from the following AFS and order.
MERGE_IN_GGAA(x1, x2)  =  x2
.(x1, x2)  =  .(x1, x2)
U8_GGAA(x1, x2, x3, x4, x5)  =  U8_GGAA(x4, x5)
gt_in_gg(x1, x2)  =  gt_in_gg
U6_GGAA(x1, x2, x3, x4, x5)  =  U6_GGAA(x3, x4)
le_out_gg  =  le_out_gg
le_in_gg(x1, x2)  =  le_in_gg(x1)
gt_out_gg  =  gt_out_gg
s(x1)  =  s
0  =  0
U11_gg(x1)  =  x1
U10_gg(x1)  =  x1

Recursive path order with status [2].
Quasi-Precedence:
[.2, U8GGAA2, U6GGAA2, leoutgg] > leingg1 > [gtingg, gtoutgg, s, 0]

Status:
leingg1: [1]
U6GGAA2: multiset
gtingg: []
0: multiset
U8GGAA2: multiset
s: multiset
.2: multiset
leoutgg: multiset
gtoutgg: multiset


The following usable rules [17] were oriented:

gt_in_gg(s(0), 0) → gt_out_gg
gt_in_gg(s(X), s(Y)) → U10_gg(gt_in_gg(X, Y))
U10_gg(gt_out_gg) → gt_out_gg



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ QDPOrderProof
QDP
                            ↳ DependencyGraphProof
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

MERGE_IN_GGAA(.(X, Xs), .(Y, Ys)) → U8_GGAA(X, Xs, Y, Ys, gt_in_gg(X, Y))
U6_GGAA(X, Xs, Y, Ys, le_out_gg) → MERGE_IN_GGAA(Xs, .(Y, Ys))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys)) → U6_GGAA(X, Xs, Y, Ys, le_in_gg(X, Y))

The TRS R consists of the following rules:

le_in_gg(s(X), s(Y)) → U11_gg(le_in_gg(X, Y))
le_in_gg(0, s(0)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
gt_in_gg(s(X), s(Y)) → U10_gg(gt_in_gg(X, Y))
gt_in_gg(s(0), 0) → gt_out_gg
U11_gg(le_out_gg) → le_out_gg
U10_gg(gt_out_gg) → gt_out_gg

The set Q consists of the following terms:

le_in_gg(x0, x1)
gt_in_gg(x0, x1)
U11_gg(x0)
U10_gg(x0)

We have to consider all (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ QDPOrderProof
                          ↳ QDP
                            ↳ DependencyGraphProof
QDP
                                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U6_GGAA(X, Xs, Y, Ys, le_out_gg) → MERGE_IN_GGAA(Xs, .(Y, Ys))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys)) → U6_GGAA(X, Xs, Y, Ys, le_in_gg(X, Y))

The TRS R consists of the following rules:

le_in_gg(s(X), s(Y)) → U11_gg(le_in_gg(X, Y))
le_in_gg(0, s(0)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
gt_in_gg(s(X), s(Y)) → U10_gg(gt_in_gg(X, Y))
gt_in_gg(s(0), 0) → gt_out_gg
U11_gg(le_out_gg) → le_out_gg
U10_gg(gt_out_gg) → gt_out_gg

The set Q consists of the following terms:

le_in_gg(x0, x1)
gt_in_gg(x0, x1)
U11_gg(x0)
U10_gg(x0)

We have to consider all (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ QDPOrderProof
                          ↳ QDP
                            ↳ DependencyGraphProof
                              ↳ QDP
                                ↳ UsableRulesProof
QDP
                                    ↳ QReductionProof
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U6_GGAA(X, Xs, Y, Ys, le_out_gg) → MERGE_IN_GGAA(Xs, .(Y, Ys))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys)) → U6_GGAA(X, Xs, Y, Ys, le_in_gg(X, Y))

The TRS R consists of the following rules:

le_in_gg(s(X), s(Y)) → U11_gg(le_in_gg(X, Y))
le_in_gg(0, s(0)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
U11_gg(le_out_gg) → le_out_gg

The set Q consists of the following terms:

le_in_gg(x0, x1)
gt_in_gg(x0, x1)
U11_gg(x0)
U10_gg(x0)

We have to consider all (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

gt_in_gg(x0, x1)
U10_gg(x0)



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ QDPOrderProof
                          ↳ QDP
                            ↳ DependencyGraphProof
                              ↳ QDP
                                ↳ UsableRulesProof
                                  ↳ QDP
                                    ↳ QReductionProof
QDP
                                        ↳ QDPSizeChangeProof
              ↳ PiDP
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U6_GGAA(X, Xs, Y, Ys, le_out_gg) → MERGE_IN_GGAA(Xs, .(Y, Ys))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys)) → U6_GGAA(X, Xs, Y, Ys, le_in_gg(X, Y))

The TRS R consists of the following rules:

le_in_gg(s(X), s(Y)) → U11_gg(le_in_gg(X, Y))
le_in_gg(0, s(0)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
U11_gg(le_out_gg) → le_out_gg

The set Q consists of the following terms:

le_in_gg(x0, x1)
U11_gg(x0)

We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

SPLIT_IN_GAAA(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → SPLIT_IN_GAAA(Xs, Zs, Ys, Ls)

The TRS R consists of the following rules:

mergesort_in_gaa([], [], Ls) → mergesort_out_gaa([], [], Ls)
mergesort_in_gaa(.(X, []), .(X, []), Ls) → mergesort_out_gaa(.(X, []), .(X, []), Ls)
mergesort_in_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_gaa(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
split_in_gaaa([], [], [], Ls) → split_out_gaaa([], [], [], Ls)
split_in_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_out_gaaa(Xs, Zs, Ys, Ls)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls))
U1_gaa(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_gaa(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
merge_in_ggaa([], Xs, Xs, Ls) → merge_out_ggaa([], Xs, Xs, Ls)
merge_in_ggaa(Xs, [], Xs, Ls) → merge_out_ggaa(Xs, [], Xs, Ls)
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(0)) → le_out_gg(0, s(0))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(.(X, Xs), Ys, Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls))
U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(Xs, .(Y, Ys), Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls))
U4_gaa(X, Y, Xs, Ys, H, Ls, merge_out_ggaa(Y1s, Y2s, Ys, .(H, Ls))) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls))

The argument filtering Pi contains the following mapping:
mergesort_in_gaa(x1, x2, x3)  =  mergesort_in_gaa(x1)
[]  =  []
mergesort_out_gaa(x1, x2, x3)  =  mergesort_out_gaa(x2)
.(x1, x2)  =  .(x1, x2)
U1_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U1_gaa(x7)
split_in_gaaa(x1, x2, x3, x4)  =  split_in_gaaa(x1)
split_out_gaaa(x1, x2, x3, x4)  =  split_out_gaaa(x2, x3)
U5_gaaa(x1, x2, x3, x4, x5, x6, x7)  =  U5_gaaa(x1, x7)
U2_gaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U2_gaa(x7, x8)
U3_gaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U3_gaa(x7, x8)
U4_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U4_gaa(x7)
merge_in_ggaa(x1, x2, x3, x4)  =  merge_in_ggaa(x1, x2)
merge_out_ggaa(x1, x2, x3, x4)  =  merge_out_ggaa(x3)
U6_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U6_ggaa(x1, x2, x3, x4, x8)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U7_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_ggaa(x1, x8)
U8_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U8_ggaa(x1, x2, x3, x4, x8)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U9_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U9_ggaa(x3, x8)
SPLIT_IN_GAAA(x1, x2, x3, x4)  =  SPLIT_IN_GAAA(x1)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

SPLIT_IN_GAAA(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → SPLIT_IN_GAAA(Xs, Zs, Ys, Ls)

R is empty.
The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
SPLIT_IN_GAAA(x1, x2, x3, x4)  =  SPLIT_IN_GAAA(x1)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

SPLIT_IN_GAAA(.(X, Xs)) → SPLIT_IN_GAAA(Xs)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ PiDPToQDPProof
  ↳ PrologToPiTRSProof

Pi DP problem:
The TRS P consists of the following rules:

MERGESORT_IN_GAA(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_GAA(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
U1_GAA(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_GAA(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_GAA(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → MERGESORT_IN_GAA(X2s, Y2s, Ls)
U1_GAA(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → MERGESORT_IN_GAA(X1s, Y1s, Ls)

The TRS R consists of the following rules:

mergesort_in_gaa([], [], Ls) → mergesort_out_gaa([], [], Ls)
mergesort_in_gaa(.(X, []), .(X, []), Ls) → mergesort_out_gaa(.(X, []), .(X, []), Ls)
mergesort_in_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_gaa(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
split_in_gaaa([], [], [], Ls) → split_out_gaaa([], [], [], Ls)
split_in_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_out_gaaa(Xs, Zs, Ys, Ls)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls))
U1_gaa(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_gaa(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
merge_in_ggaa([], Xs, Xs, Ls) → merge_out_ggaa([], Xs, Xs, Ls)
merge_in_ggaa(Xs, [], Xs, Ls) → merge_out_ggaa(Xs, [], Xs, Ls)
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(0)) → le_out_gg(0, s(0))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(.(X, Xs), Ys, Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls))
U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(Xs, .(Y, Ys), Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls))
U4_gaa(X, Y, Xs, Ys, H, Ls, merge_out_ggaa(Y1s, Y2s, Ys, .(H, Ls))) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls))

The argument filtering Pi contains the following mapping:
mergesort_in_gaa(x1, x2, x3)  =  mergesort_in_gaa(x1)
[]  =  []
mergesort_out_gaa(x1, x2, x3)  =  mergesort_out_gaa(x2)
.(x1, x2)  =  .(x1, x2)
U1_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U1_gaa(x7)
split_in_gaaa(x1, x2, x3, x4)  =  split_in_gaaa(x1)
split_out_gaaa(x1, x2, x3, x4)  =  split_out_gaaa(x2, x3)
U5_gaaa(x1, x2, x3, x4, x5, x6, x7)  =  U5_gaaa(x1, x7)
U2_gaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U2_gaa(x7, x8)
U3_gaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U3_gaa(x7, x8)
U4_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U4_gaa(x7)
merge_in_ggaa(x1, x2, x3, x4)  =  merge_in_ggaa(x1, x2)
merge_out_ggaa(x1, x2, x3, x4)  =  merge_out_ggaa(x3)
U6_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U6_ggaa(x1, x2, x3, x4, x8)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg
U7_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_ggaa(x1, x8)
U8_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U8_ggaa(x1, x2, x3, x4, x8)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x3)
gt_out_gg(x1, x2)  =  gt_out_gg
U9_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U9_ggaa(x3, x8)
U2_GAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U2_GAA(x7, x8)
U1_GAA(x1, x2, x3, x4, x5, x6, x7)  =  U1_GAA(x7)
MERGESORT_IN_GAA(x1, x2, x3)  =  MERGESORT_IN_GAA(x1)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
QDP
                    ↳ Rewriting
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U1_GAA(split_out_gaaa(X1s, X2s)) → U2_GAA(X2s, mergesort_in_gaa(X1s))
U1_GAA(split_out_gaaa(X1s, X2s)) → MERGESORT_IN_GAA(X1s)
MERGESORT_IN_GAA(.(X, .(Y, Xs))) → U1_GAA(split_in_gaaa(.(X, .(Y, Xs))))
U2_GAA(X2s, mergesort_out_gaa(Y1s)) → MERGESORT_IN_GAA(X2s)

The TRS R consists of the following rules:

mergesort_in_gaa([]) → mergesort_out_gaa([])
mergesort_in_gaa(.(X, [])) → mergesort_out_gaa(.(X, []))
mergesort_in_gaa(.(X, .(Y, Xs))) → U1_gaa(split_in_gaaa(.(X, .(Y, Xs))))
split_in_gaaa([]) → split_out_gaaa([], [])
split_in_gaaa(.(X, Xs)) → U5_gaaa(X, split_in_gaaa(Xs))
U5_gaaa(X, split_out_gaaa(Zs, Ys)) → split_out_gaaa(.(X, Ys), Zs)
U1_gaa(split_out_gaaa(X1s, X2s)) → U2_gaa(X2s, mergesort_in_gaa(X1s))
U2_gaa(X2s, mergesort_out_gaa(Y1s)) → U3_gaa(Y1s, mergesort_in_gaa(X2s))
U3_gaa(Y1s, mergesort_out_gaa(Y2s)) → U4_gaa(merge_in_ggaa(Y1s, Y2s))
merge_in_ggaa([], Xs) → merge_out_ggaa(Xs)
merge_in_ggaa(Xs, []) → merge_out_ggaa(Xs)
merge_in_ggaa(.(X, Xs), .(Y, Ys)) → U6_ggaa(X, Xs, Y, Ys, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(le_in_gg(X, Y))
le_in_gg(0, s(0)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
U11_gg(le_out_gg) → le_out_gg
U6_ggaa(X, Xs, Y, Ys, le_out_gg) → U7_ggaa(X, merge_in_ggaa(Xs, .(Y, Ys)))
merge_in_ggaa(.(X, Xs), .(Y, Ys)) → U8_ggaa(X, Xs, Y, Ys, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(gt_in_gg(X, Y))
gt_in_gg(s(0), 0) → gt_out_gg
U10_gg(gt_out_gg) → gt_out_gg
U8_ggaa(X, Xs, Y, Ys, gt_out_gg) → U9_ggaa(Y, merge_in_ggaa(.(X, Xs), Ys))
U9_ggaa(Y, merge_out_ggaa(Zs)) → merge_out_ggaa(.(Y, Zs))
U7_ggaa(X, merge_out_ggaa(Zs)) → merge_out_ggaa(.(X, Zs))
U4_gaa(merge_out_ggaa(Ys)) → mergesort_out_gaa(Ys)

The set Q consists of the following terms:

mergesort_in_gaa(x0)
split_in_gaaa(x0)
U5_gaaa(x0, x1)
U1_gaa(x0)
U2_gaa(x0, x1)
U3_gaa(x0, x1)
merge_in_ggaa(x0, x1)
le_in_gg(x0, x1)
U11_gg(x0)
U6_ggaa(x0, x1, x2, x3, x4)
gt_in_gg(x0, x1)
U10_gg(x0)
U8_ggaa(x0, x1, x2, x3, x4)
U9_ggaa(x0, x1)
U7_ggaa(x0, x1)
U4_gaa(x0)

We have to consider all (P,Q,R)-chains.
By rewriting [15] the rule MERGESORT_IN_GAA(.(X, .(Y, Xs))) → U1_GAA(split_in_gaaa(.(X, .(Y, Xs)))) at position [0] we obtained the following new rules:

MERGESORT_IN_GAA(.(X, .(Y, Xs))) → U1_GAA(U5_gaaa(X, split_in_gaaa(.(Y, Xs))))



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ Rewriting
QDP
                        ↳ Rewriting
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U1_GAA(split_out_gaaa(X1s, X2s)) → U2_GAA(X2s, mergesort_in_gaa(X1s))
MERGESORT_IN_GAA(.(X, .(Y, Xs))) → U1_GAA(U5_gaaa(X, split_in_gaaa(.(Y, Xs))))
U1_GAA(split_out_gaaa(X1s, X2s)) → MERGESORT_IN_GAA(X1s)
U2_GAA(X2s, mergesort_out_gaa(Y1s)) → MERGESORT_IN_GAA(X2s)

The TRS R consists of the following rules:

mergesort_in_gaa([]) → mergesort_out_gaa([])
mergesort_in_gaa(.(X, [])) → mergesort_out_gaa(.(X, []))
mergesort_in_gaa(.(X, .(Y, Xs))) → U1_gaa(split_in_gaaa(.(X, .(Y, Xs))))
split_in_gaaa([]) → split_out_gaaa([], [])
split_in_gaaa(.(X, Xs)) → U5_gaaa(X, split_in_gaaa(Xs))
U5_gaaa(X, split_out_gaaa(Zs, Ys)) → split_out_gaaa(.(X, Ys), Zs)
U1_gaa(split_out_gaaa(X1s, X2s)) → U2_gaa(X2s, mergesort_in_gaa(X1s))
U2_gaa(X2s, mergesort_out_gaa(Y1s)) → U3_gaa(Y1s, mergesort_in_gaa(X2s))
U3_gaa(Y1s, mergesort_out_gaa(Y2s)) → U4_gaa(merge_in_ggaa(Y1s, Y2s))
merge_in_ggaa([], Xs) → merge_out_ggaa(Xs)
merge_in_ggaa(Xs, []) → merge_out_ggaa(Xs)
merge_in_ggaa(.(X, Xs), .(Y, Ys)) → U6_ggaa(X, Xs, Y, Ys, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(le_in_gg(X, Y))
le_in_gg(0, s(0)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
U11_gg(le_out_gg) → le_out_gg
U6_ggaa(X, Xs, Y, Ys, le_out_gg) → U7_ggaa(X, merge_in_ggaa(Xs, .(Y, Ys)))
merge_in_ggaa(.(X, Xs), .(Y, Ys)) → U8_ggaa(X, Xs, Y, Ys, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(gt_in_gg(X, Y))
gt_in_gg(s(0), 0) → gt_out_gg
U10_gg(gt_out_gg) → gt_out_gg
U8_ggaa(X, Xs, Y, Ys, gt_out_gg) → U9_ggaa(Y, merge_in_ggaa(.(X, Xs), Ys))
U9_ggaa(Y, merge_out_ggaa(Zs)) → merge_out_ggaa(.(Y, Zs))
U7_ggaa(X, merge_out_ggaa(Zs)) → merge_out_ggaa(.(X, Zs))
U4_gaa(merge_out_ggaa(Ys)) → mergesort_out_gaa(Ys)

The set Q consists of the following terms:

mergesort_in_gaa(x0)
split_in_gaaa(x0)
U5_gaaa(x0, x1)
U1_gaa(x0)
U2_gaa(x0, x1)
U3_gaa(x0, x1)
merge_in_ggaa(x0, x1)
le_in_gg(x0, x1)
U11_gg(x0)
U6_ggaa(x0, x1, x2, x3, x4)
gt_in_gg(x0, x1)
U10_gg(x0)
U8_ggaa(x0, x1, x2, x3, x4)
U9_ggaa(x0, x1)
U7_ggaa(x0, x1)
U4_gaa(x0)

We have to consider all (P,Q,R)-chains.
By rewriting [15] the rule MERGESORT_IN_GAA(.(X, .(Y, Xs))) → U1_GAA(U5_gaaa(X, split_in_gaaa(.(Y, Xs)))) at position [0,1] we obtained the following new rules:

MERGESORT_IN_GAA(.(X, .(Y, Xs))) → U1_GAA(U5_gaaa(X, U5_gaaa(Y, split_in_gaaa(Xs))))



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ Rewriting
                      ↳ QDP
                        ↳ Rewriting
QDP
                            ↳ QDPOrderProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U1_GAA(split_out_gaaa(X1s, X2s)) → U2_GAA(X2s, mergesort_in_gaa(X1s))
U1_GAA(split_out_gaaa(X1s, X2s)) → MERGESORT_IN_GAA(X1s)
MERGESORT_IN_GAA(.(X, .(Y, Xs))) → U1_GAA(U5_gaaa(X, U5_gaaa(Y, split_in_gaaa(Xs))))
U2_GAA(X2s, mergesort_out_gaa(Y1s)) → MERGESORT_IN_GAA(X2s)

The TRS R consists of the following rules:

mergesort_in_gaa([]) → mergesort_out_gaa([])
mergesort_in_gaa(.(X, [])) → mergesort_out_gaa(.(X, []))
mergesort_in_gaa(.(X, .(Y, Xs))) → U1_gaa(split_in_gaaa(.(X, .(Y, Xs))))
split_in_gaaa([]) → split_out_gaaa([], [])
split_in_gaaa(.(X, Xs)) → U5_gaaa(X, split_in_gaaa(Xs))
U5_gaaa(X, split_out_gaaa(Zs, Ys)) → split_out_gaaa(.(X, Ys), Zs)
U1_gaa(split_out_gaaa(X1s, X2s)) → U2_gaa(X2s, mergesort_in_gaa(X1s))
U2_gaa(X2s, mergesort_out_gaa(Y1s)) → U3_gaa(Y1s, mergesort_in_gaa(X2s))
U3_gaa(Y1s, mergesort_out_gaa(Y2s)) → U4_gaa(merge_in_ggaa(Y1s, Y2s))
merge_in_ggaa([], Xs) → merge_out_ggaa(Xs)
merge_in_ggaa(Xs, []) → merge_out_ggaa(Xs)
merge_in_ggaa(.(X, Xs), .(Y, Ys)) → U6_ggaa(X, Xs, Y, Ys, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(le_in_gg(X, Y))
le_in_gg(0, s(0)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
U11_gg(le_out_gg) → le_out_gg
U6_ggaa(X, Xs, Y, Ys, le_out_gg) → U7_ggaa(X, merge_in_ggaa(Xs, .(Y, Ys)))
merge_in_ggaa(.(X, Xs), .(Y, Ys)) → U8_ggaa(X, Xs, Y, Ys, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(gt_in_gg(X, Y))
gt_in_gg(s(0), 0) → gt_out_gg
U10_gg(gt_out_gg) → gt_out_gg
U8_ggaa(X, Xs, Y, Ys, gt_out_gg) → U9_ggaa(Y, merge_in_ggaa(.(X, Xs), Ys))
U9_ggaa(Y, merge_out_ggaa(Zs)) → merge_out_ggaa(.(Y, Zs))
U7_ggaa(X, merge_out_ggaa(Zs)) → merge_out_ggaa(.(X, Zs))
U4_gaa(merge_out_ggaa(Ys)) → mergesort_out_gaa(Ys)

The set Q consists of the following terms:

mergesort_in_gaa(x0)
split_in_gaaa(x0)
U5_gaaa(x0, x1)
U1_gaa(x0)
U2_gaa(x0, x1)
U3_gaa(x0, x1)
merge_in_ggaa(x0, x1)
le_in_gg(x0, x1)
U11_gg(x0)
U6_ggaa(x0, x1, x2, x3, x4)
gt_in_gg(x0, x1)
U10_gg(x0)
U8_ggaa(x0, x1, x2, x3, x4)
U9_ggaa(x0, x1)
U7_ggaa(x0, x1)
U4_gaa(x0)

We have to consider all (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


U2_GAA(X2s, mergesort_out_gaa(Y1s)) → MERGESORT_IN_GAA(X2s)
The remaining pairs can at least be oriented weakly.

U1_GAA(split_out_gaaa(X1s, X2s)) → U2_GAA(X2s, mergesort_in_gaa(X1s))
U1_GAA(split_out_gaaa(X1s, X2s)) → MERGESORT_IN_GAA(X1s)
MERGESORT_IN_GAA(.(X, .(Y, Xs))) → U1_GAA(U5_gaaa(X, U5_gaaa(Y, split_in_gaaa(Xs))))
Used ordering: Matrix interpretation [3]:
Non-tuple symbols:
M( le_in_gg(x1, x2) ) =
/0\
\0/
+
/00\
\00/
·x1+
/00\
\00/
·x2

M( merge_out_ggaa(x1) ) =
/0\
\0/
+
/00\
\00/
·x1

M( U5_gaaa(x1, x2) ) =
/0\
\1/
+
/00\
\00/
·x1+
/01\
\01/
·x2

M( U4_gaa(x1) ) =
/1\
\0/
+
/00\
\00/
·x1

M( [] ) =
/1\
\0/

M( 0 ) =
/0\
\0/

M( U9_ggaa(x1, x2) ) =
/0\
\0/
+
/00\
\00/
·x1+
/00\
\00/
·x2

M( U3_gaa(x1, x2) ) =
/1\
\0/
+
/00\
\00/
·x1+
/00\
\00/
·x2

M( s(x1) ) =
/0\
\0/
+
/00\
\00/
·x1

M( U10_gg(x1) ) =
/0\
\0/
+
/00\
\00/
·x1

M( U11_gg(x1) ) =
/0\
\0/
+
/00\
\00/
·x1

M( mergesort_out_gaa(x1) ) =
/1\
\0/
+
/00\
\00/
·x1

M( gt_in_gg(x1, x2) ) =
/0\
\0/
+
/00\
\00/
·x1+
/00\
\00/
·x2

M( merge_in_ggaa(x1, x2) ) =
/0\
\0/
+
/00\
\00/
·x1+
/00\
\00/
·x2

M( le_out_gg ) =
/0\
\0/

M( U1_gaa(x1) ) =
/1\
\0/
+
/00\
\00/
·x1

M( split_out_gaaa(x1, x2) ) =
/0\
\1/
+
/11\
\01/
·x1+
/01\
\01/
·x2

M( .(x1, x2) ) =
/0\
\1/
+
/00\
\00/
·x1+
/00\
\01/
·x2

M( U6_ggaa(x1, ..., x5) ) =
/0\
\0/
+
/00\
\00/
·x1+
/00\
\00/
·x2+
/00\
\00/
·x3+
/00\
\00/
·x4+
/00\
\00/
·x5

M( U7_ggaa(x1, x2) ) =
/0\
\0/
+
/00\
\00/
·x1+
/00\
\00/
·x2

M( mergesort_in_gaa(x1) ) =
/0\
\0/
+
/11\
\00/
·x1

M( U8_ggaa(x1, ..., x5) ) =
/0\
\0/
+
/00\
\00/
·x1+
/00\
\00/
·x2+
/00\
\00/
·x3+
/00\
\00/
·x4+
/00\
\00/
·x5

M( split_in_gaaa(x1) ) =
/0\
\1/
+
/11\
\01/
·x1

M( U2_gaa(x1, x2) ) =
/1\
\0/
+
/00\
\00/
·x1+
/00\
\00/
·x2

M( gt_out_gg ) =
/0\
\0/

Tuple symbols:
M( U1_GAA(x1) ) = 0+
[1,0]
·x1

M( MERGESORT_IN_GAA(x1) ) = 0+
[0,1]
·x1

M( U2_GAA(x1, x2) ) = 0+
[0,1]
·x1+
[1,0]
·x2


Matrix type:
We used a basic matrix type which is not further parametrizeable.


As matrix orders are CE-compatible, we used usable rules w.r.t. argument filtering in the order.
The following usable rules [17] were oriented:

U5_gaaa(X, split_out_gaaa(Zs, Ys)) → split_out_gaaa(.(X, Ys), Zs)
split_in_gaaa(.(X, Xs)) → U5_gaaa(X, split_in_gaaa(Xs))
U3_gaa(Y1s, mergesort_out_gaa(Y2s)) → U4_gaa(merge_in_ggaa(Y1s, Y2s))
U2_gaa(X2s, mergesort_out_gaa(Y1s)) → U3_gaa(Y1s, mergesort_in_gaa(X2s))
U4_gaa(merge_out_ggaa(Ys)) → mergesort_out_gaa(Ys)
U1_gaa(split_out_gaaa(X1s, X2s)) → U2_gaa(X2s, mergesort_in_gaa(X1s))
split_in_gaaa([]) → split_out_gaaa([], [])
mergesort_in_gaa([]) → mergesort_out_gaa([])
mergesort_in_gaa(.(X, [])) → mergesort_out_gaa(.(X, []))
mergesort_in_gaa(.(X, .(Y, Xs))) → U1_gaa(split_in_gaaa(.(X, .(Y, Xs))))



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ Rewriting
                      ↳ QDP
                        ↳ Rewriting
                          ↳ QDP
                            ↳ QDPOrderProof
QDP
                                ↳ DependencyGraphProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U1_GAA(split_out_gaaa(X1s, X2s)) → U2_GAA(X2s, mergesort_in_gaa(X1s))
U1_GAA(split_out_gaaa(X1s, X2s)) → MERGESORT_IN_GAA(X1s)
MERGESORT_IN_GAA(.(X, .(Y, Xs))) → U1_GAA(U5_gaaa(X, U5_gaaa(Y, split_in_gaaa(Xs))))

The TRS R consists of the following rules:

mergesort_in_gaa([]) → mergesort_out_gaa([])
mergesort_in_gaa(.(X, [])) → mergesort_out_gaa(.(X, []))
mergesort_in_gaa(.(X, .(Y, Xs))) → U1_gaa(split_in_gaaa(.(X, .(Y, Xs))))
split_in_gaaa([]) → split_out_gaaa([], [])
split_in_gaaa(.(X, Xs)) → U5_gaaa(X, split_in_gaaa(Xs))
U5_gaaa(X, split_out_gaaa(Zs, Ys)) → split_out_gaaa(.(X, Ys), Zs)
U1_gaa(split_out_gaaa(X1s, X2s)) → U2_gaa(X2s, mergesort_in_gaa(X1s))
U2_gaa(X2s, mergesort_out_gaa(Y1s)) → U3_gaa(Y1s, mergesort_in_gaa(X2s))
U3_gaa(Y1s, mergesort_out_gaa(Y2s)) → U4_gaa(merge_in_ggaa(Y1s, Y2s))
merge_in_ggaa([], Xs) → merge_out_ggaa(Xs)
merge_in_ggaa(Xs, []) → merge_out_ggaa(Xs)
merge_in_ggaa(.(X, Xs), .(Y, Ys)) → U6_ggaa(X, Xs, Y, Ys, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(le_in_gg(X, Y))
le_in_gg(0, s(0)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
U11_gg(le_out_gg) → le_out_gg
U6_ggaa(X, Xs, Y, Ys, le_out_gg) → U7_ggaa(X, merge_in_ggaa(Xs, .(Y, Ys)))
merge_in_ggaa(.(X, Xs), .(Y, Ys)) → U8_ggaa(X, Xs, Y, Ys, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(gt_in_gg(X, Y))
gt_in_gg(s(0), 0) → gt_out_gg
U10_gg(gt_out_gg) → gt_out_gg
U8_ggaa(X, Xs, Y, Ys, gt_out_gg) → U9_ggaa(Y, merge_in_ggaa(.(X, Xs), Ys))
U9_ggaa(Y, merge_out_ggaa(Zs)) → merge_out_ggaa(.(Y, Zs))
U7_ggaa(X, merge_out_ggaa(Zs)) → merge_out_ggaa(.(X, Zs))
U4_gaa(merge_out_ggaa(Ys)) → mergesort_out_gaa(Ys)

The set Q consists of the following terms:

mergesort_in_gaa(x0)
split_in_gaaa(x0)
U5_gaaa(x0, x1)
U1_gaa(x0)
U2_gaa(x0, x1)
U3_gaa(x0, x1)
merge_in_ggaa(x0, x1)
le_in_gg(x0, x1)
U11_gg(x0)
U6_ggaa(x0, x1, x2, x3, x4)
gt_in_gg(x0, x1)
U10_gg(x0)
U8_ggaa(x0, x1, x2, x3, x4)
U9_ggaa(x0, x1)
U7_ggaa(x0, x1)
U4_gaa(x0)

We have to consider all (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ Rewriting
                      ↳ QDP
                        ↳ Rewriting
                          ↳ QDP
                            ↳ QDPOrderProof
                              ↳ QDP
                                ↳ DependencyGraphProof
QDP
                                    ↳ UsableRulesProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U1_GAA(split_out_gaaa(X1s, X2s)) → MERGESORT_IN_GAA(X1s)
MERGESORT_IN_GAA(.(X, .(Y, Xs))) → U1_GAA(U5_gaaa(X, U5_gaaa(Y, split_in_gaaa(Xs))))

The TRS R consists of the following rules:

mergesort_in_gaa([]) → mergesort_out_gaa([])
mergesort_in_gaa(.(X, [])) → mergesort_out_gaa(.(X, []))
mergesort_in_gaa(.(X, .(Y, Xs))) → U1_gaa(split_in_gaaa(.(X, .(Y, Xs))))
split_in_gaaa([]) → split_out_gaaa([], [])
split_in_gaaa(.(X, Xs)) → U5_gaaa(X, split_in_gaaa(Xs))
U5_gaaa(X, split_out_gaaa(Zs, Ys)) → split_out_gaaa(.(X, Ys), Zs)
U1_gaa(split_out_gaaa(X1s, X2s)) → U2_gaa(X2s, mergesort_in_gaa(X1s))
U2_gaa(X2s, mergesort_out_gaa(Y1s)) → U3_gaa(Y1s, mergesort_in_gaa(X2s))
U3_gaa(Y1s, mergesort_out_gaa(Y2s)) → U4_gaa(merge_in_ggaa(Y1s, Y2s))
merge_in_ggaa([], Xs) → merge_out_ggaa(Xs)
merge_in_ggaa(Xs, []) → merge_out_ggaa(Xs)
merge_in_ggaa(.(X, Xs), .(Y, Ys)) → U6_ggaa(X, Xs, Y, Ys, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(le_in_gg(X, Y))
le_in_gg(0, s(0)) → le_out_gg
le_in_gg(0, 0) → le_out_gg
U11_gg(le_out_gg) → le_out_gg
U6_ggaa(X, Xs, Y, Ys, le_out_gg) → U7_ggaa(X, merge_in_ggaa(Xs, .(Y, Ys)))
merge_in_ggaa(.(X, Xs), .(Y, Ys)) → U8_ggaa(X, Xs, Y, Ys, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(gt_in_gg(X, Y))
gt_in_gg(s(0), 0) → gt_out_gg
U10_gg(gt_out_gg) → gt_out_gg
U8_ggaa(X, Xs, Y, Ys, gt_out_gg) → U9_ggaa(Y, merge_in_ggaa(.(X, Xs), Ys))
U9_ggaa(Y, merge_out_ggaa(Zs)) → merge_out_ggaa(.(Y, Zs))
U7_ggaa(X, merge_out_ggaa(Zs)) → merge_out_ggaa(.(X, Zs))
U4_gaa(merge_out_ggaa(Ys)) → mergesort_out_gaa(Ys)

The set Q consists of the following terms:

mergesort_in_gaa(x0)
split_in_gaaa(x0)
U5_gaaa(x0, x1)
U1_gaa(x0)
U2_gaa(x0, x1)
U3_gaa(x0, x1)
merge_in_ggaa(x0, x1)
le_in_gg(x0, x1)
U11_gg(x0)
U6_ggaa(x0, x1, x2, x3, x4)
gt_in_gg(x0, x1)
U10_gg(x0)
U8_ggaa(x0, x1, x2, x3, x4)
U9_ggaa(x0, x1)
U7_ggaa(x0, x1)
U4_gaa(x0)

We have to consider all (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ Rewriting
                      ↳ QDP
                        ↳ Rewriting
                          ↳ QDP
                            ↳ QDPOrderProof
                              ↳ QDP
                                ↳ DependencyGraphProof
                                  ↳ QDP
                                    ↳ UsableRulesProof
QDP
                                        ↳ QReductionProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U1_GAA(split_out_gaaa(X1s, X2s)) → MERGESORT_IN_GAA(X1s)
MERGESORT_IN_GAA(.(X, .(Y, Xs))) → U1_GAA(U5_gaaa(X, U5_gaaa(Y, split_in_gaaa(Xs))))

The TRS R consists of the following rules:

split_in_gaaa([]) → split_out_gaaa([], [])
split_in_gaaa(.(X, Xs)) → U5_gaaa(X, split_in_gaaa(Xs))
U5_gaaa(X, split_out_gaaa(Zs, Ys)) → split_out_gaaa(.(X, Ys), Zs)

The set Q consists of the following terms:

mergesort_in_gaa(x0)
split_in_gaaa(x0)
U5_gaaa(x0, x1)
U1_gaa(x0)
U2_gaa(x0, x1)
U3_gaa(x0, x1)
merge_in_ggaa(x0, x1)
le_in_gg(x0, x1)
U11_gg(x0)
U6_ggaa(x0, x1, x2, x3, x4)
gt_in_gg(x0, x1)
U10_gg(x0)
U8_ggaa(x0, x1, x2, x3, x4)
U9_ggaa(x0, x1)
U7_ggaa(x0, x1)
U4_gaa(x0)

We have to consider all (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

mergesort_in_gaa(x0)
U1_gaa(x0)
U2_gaa(x0, x1)
U3_gaa(x0, x1)
merge_in_ggaa(x0, x1)
le_in_gg(x0, x1)
U11_gg(x0)
U6_ggaa(x0, x1, x2, x3, x4)
gt_in_gg(x0, x1)
U10_gg(x0)
U8_ggaa(x0, x1, x2, x3, x4)
U9_ggaa(x0, x1)
U7_ggaa(x0, x1)
U4_gaa(x0)



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ Rewriting
                      ↳ QDP
                        ↳ Rewriting
                          ↳ QDP
                            ↳ QDPOrderProof
                              ↳ QDP
                                ↳ DependencyGraphProof
                                  ↳ QDP
                                    ↳ UsableRulesProof
                                      ↳ QDP
                                        ↳ QReductionProof
QDP
                                            ↳ QDPOrderProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U1_GAA(split_out_gaaa(X1s, X2s)) → MERGESORT_IN_GAA(X1s)
MERGESORT_IN_GAA(.(X, .(Y, Xs))) → U1_GAA(U5_gaaa(X, U5_gaaa(Y, split_in_gaaa(Xs))))

The TRS R consists of the following rules:

split_in_gaaa([]) → split_out_gaaa([], [])
split_in_gaaa(.(X, Xs)) → U5_gaaa(X, split_in_gaaa(Xs))
U5_gaaa(X, split_out_gaaa(Zs, Ys)) → split_out_gaaa(.(X, Ys), Zs)

The set Q consists of the following terms:

split_in_gaaa(x0)
U5_gaaa(x0, x1)

We have to consider all (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


MERGESORT_IN_GAA(.(X, .(Y, Xs))) → U1_GAA(U5_gaaa(X, U5_gaaa(Y, split_in_gaaa(Xs))))
The remaining pairs can at least be oriented weakly.

U1_GAA(split_out_gaaa(X1s, X2s)) → MERGESORT_IN_GAA(X1s)
Used ordering: Matrix interpretation [3]:
Non-tuple symbols:
M( U5_gaaa(x1, x2) ) =
/1\
\0/
+
/00\
\00/
·x1+
/01\
\10/
·x2

M( split_out_gaaa(x1, x2) ) =
/0\
\0/
+
/01\
\00/
·x1+
/00\
\01/
·x2

M( [] ) =
/0\
\0/

M( split_in_gaaa(x1) ) =
/0\
\0/
+
/01\
\01/
·x1

M( .(x1, x2) ) =
/0\
\1/
+
/00\
\00/
·x1+
/00\
\01/
·x2

Tuple symbols:
M( U1_GAA(x1) ) = 0+
[1,0]
·x1

M( MERGESORT_IN_GAA(x1) ) = 0+
[0,1]
·x1


Matrix type:
We used a basic matrix type which is not further parametrizeable.


As matrix orders are CE-compatible, we used usable rules w.r.t. argument filtering in the order.
The following usable rules [17] were oriented:

split_in_gaaa([]) → split_out_gaaa([], [])
split_in_gaaa(.(X, Xs)) → U5_gaaa(X, split_in_gaaa(Xs))
U5_gaaa(X, split_out_gaaa(Zs, Ys)) → split_out_gaaa(.(X, Ys), Zs)



↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
                  ↳ QDP
                    ↳ Rewriting
                      ↳ QDP
                        ↳ Rewriting
                          ↳ QDP
                            ↳ QDPOrderProof
                              ↳ QDP
                                ↳ DependencyGraphProof
                                  ↳ QDP
                                    ↳ UsableRulesProof
                                      ↳ QDP
                                        ↳ QReductionProof
                                          ↳ QDP
                                            ↳ QDPOrderProof
QDP
                                                ↳ DependencyGraphProof
  ↳ PrologToPiTRSProof

Q DP problem:
The TRS P consists of the following rules:

U1_GAA(split_out_gaaa(X1s, X2s)) → MERGESORT_IN_GAA(X1s)

The TRS R consists of the following rules:

split_in_gaaa([]) → split_out_gaaa([], [])
split_in_gaaa(.(X, Xs)) → U5_gaaa(X, split_in_gaaa(Xs))
U5_gaaa(X, split_out_gaaa(Zs, Ys)) → split_out_gaaa(.(X, Ys), Zs)

The set Q consists of the following terms:

split_in_gaaa(x0)
U5_gaaa(x0, x1)

We have to consider all (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 0 SCCs with 1 less node.
We use the technique of [30]. With regard to the inferred argument filtering the predicates were used in the following modes:
mergesort_in: (b,f,f)
split_in: (b,f,f,f)
merge_in: (b,b,f,f)
le_in: (b,b)
gt_in: (b,b)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

mergesort_in_gaa([], [], Ls) → mergesort_out_gaa([], [], Ls)
mergesort_in_gaa(.(X, []), .(X, []), Ls) → mergesort_out_gaa(.(X, []), .(X, []), Ls)
mergesort_in_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_gaa(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
split_in_gaaa([], [], [], Ls) → split_out_gaaa([], [], [], Ls)
split_in_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_out_gaaa(Xs, Zs, Ys, Ls)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls))
U1_gaa(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_gaa(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
merge_in_ggaa([], Xs, Xs, Ls) → merge_out_ggaa([], Xs, Xs, Ls)
merge_in_ggaa(Xs, [], Xs, Ls) → merge_out_ggaa(Xs, [], Xs, Ls)
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(0)) → le_out_gg(0, s(0))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(.(X, Xs), Ys, Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls))
U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(Xs, .(Y, Ys), Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls))
U4_gaa(X, Y, Xs, Ys, H, Ls, merge_out_ggaa(Y1s, Y2s, Ys, .(H, Ls))) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls))

The argument filtering Pi contains the following mapping:
mergesort_in_gaa(x1, x2, x3)  =  mergesort_in_gaa(x1)
[]  =  []
mergesort_out_gaa(x1, x2, x3)  =  mergesort_out_gaa(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U1_gaa(x1, x2, x3, x7)
split_in_gaaa(x1, x2, x3, x4)  =  split_in_gaaa(x1)
split_out_gaaa(x1, x2, x3, x4)  =  split_out_gaaa(x1, x2, x3)
U5_gaaa(x1, x2, x3, x4, x5, x6, x7)  =  U5_gaaa(x1, x2, x7)
U2_gaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U2_gaa(x1, x2, x3, x7, x8)
U3_gaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U3_gaa(x1, x2, x3, x7, x8)
U4_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U4_gaa(x1, x2, x3, x7)
merge_in_ggaa(x1, x2, x3, x4)  =  merge_in_ggaa(x1, x2)
merge_out_ggaa(x1, x2, x3, x4)  =  merge_out_ggaa(x1, x2, x3)
U6_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U6_ggaa(x1, x2, x3, x4, x8)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U7_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_ggaa(x1, x2, x3, x4, x8)
U8_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U8_ggaa(x1, x2, x3, x4, x8)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U9_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U9_ggaa(x1, x2, x3, x4, x8)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

mergesort_in_gaa([], [], Ls) → mergesort_out_gaa([], [], Ls)
mergesort_in_gaa(.(X, []), .(X, []), Ls) → mergesort_out_gaa(.(X, []), .(X, []), Ls)
mergesort_in_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_gaa(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
split_in_gaaa([], [], [], Ls) → split_out_gaaa([], [], [], Ls)
split_in_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_out_gaaa(Xs, Zs, Ys, Ls)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls))
U1_gaa(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_gaa(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
merge_in_ggaa([], Xs, Xs, Ls) → merge_out_ggaa([], Xs, Xs, Ls)
merge_in_ggaa(Xs, [], Xs, Ls) → merge_out_ggaa(Xs, [], Xs, Ls)
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(0)) → le_out_gg(0, s(0))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(.(X, Xs), Ys, Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls))
U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(Xs, .(Y, Ys), Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls))
U4_gaa(X, Y, Xs, Ys, H, Ls, merge_out_ggaa(Y1s, Y2s, Ys, .(H, Ls))) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls))

The argument filtering Pi contains the following mapping:
mergesort_in_gaa(x1, x2, x3)  =  mergesort_in_gaa(x1)
[]  =  []
mergesort_out_gaa(x1, x2, x3)  =  mergesort_out_gaa(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U1_gaa(x1, x2, x3, x7)
split_in_gaaa(x1, x2, x3, x4)  =  split_in_gaaa(x1)
split_out_gaaa(x1, x2, x3, x4)  =  split_out_gaaa(x1, x2, x3)
U5_gaaa(x1, x2, x3, x4, x5, x6, x7)  =  U5_gaaa(x1, x2, x7)
U2_gaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U2_gaa(x1, x2, x3, x7, x8)
U3_gaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U3_gaa(x1, x2, x3, x7, x8)
U4_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U4_gaa(x1, x2, x3, x7)
merge_in_ggaa(x1, x2, x3, x4)  =  merge_in_ggaa(x1, x2)
merge_out_ggaa(x1, x2, x3, x4)  =  merge_out_ggaa(x1, x2, x3)
U6_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U6_ggaa(x1, x2, x3, x4, x8)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U7_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_ggaa(x1, x2, x3, x4, x8)
U8_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U8_ggaa(x1, x2, x3, x4, x8)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U9_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U9_ggaa(x1, x2, x3, x4, x8)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

MERGESORT_IN_GAA(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_GAA(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
MERGESORT_IN_GAA(.(X, .(Y, Xs)), Ys, .(H, Ls)) → SPLIT_IN_GAAA(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))
SPLIT_IN_GAAA(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_GAAA(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
SPLIT_IN_GAAA(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → SPLIT_IN_GAAA(Xs, Zs, Ys, Ls)
U1_GAA(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_GAA(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U1_GAA(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → MERGESORT_IN_GAA(X1s, Y1s, Ls)
U2_GAA(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_GAA(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U2_GAA(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → MERGESORT_IN_GAA(X2s, Y2s, Ls)
U3_GAA(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_GAA(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
U3_GAA(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → MERGE_IN_GGAA(Y1s, Y2s, Ys, .(H, Ls))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_in_gg(X, Y))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → LE_IN_GG(X, Y)
LE_IN_GG(s(X), s(Y)) → U11_GG(X, Y, le_in_gg(X, Y))
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
U6_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_GGAA(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
U6_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → MERGE_IN_GGAA(Xs, .(Y, Ys), Zs, Ls)
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_in_gg(X, Y))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → GT_IN_GG(X, Y)
GT_IN_GG(s(X), s(Y)) → U10_GG(X, Y, gt_in_gg(X, Y))
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
U8_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_GGAA(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U8_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → MERGE_IN_GGAA(.(X, Xs), Ys, Zs, Ls)

The TRS R consists of the following rules:

mergesort_in_gaa([], [], Ls) → mergesort_out_gaa([], [], Ls)
mergesort_in_gaa(.(X, []), .(X, []), Ls) → mergesort_out_gaa(.(X, []), .(X, []), Ls)
mergesort_in_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_gaa(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
split_in_gaaa([], [], [], Ls) → split_out_gaaa([], [], [], Ls)
split_in_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_out_gaaa(Xs, Zs, Ys, Ls)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls))
U1_gaa(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_gaa(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
merge_in_ggaa([], Xs, Xs, Ls) → merge_out_ggaa([], Xs, Xs, Ls)
merge_in_ggaa(Xs, [], Xs, Ls) → merge_out_ggaa(Xs, [], Xs, Ls)
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(0)) → le_out_gg(0, s(0))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(.(X, Xs), Ys, Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls))
U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(Xs, .(Y, Ys), Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls))
U4_gaa(X, Y, Xs, Ys, H, Ls, merge_out_ggaa(Y1s, Y2s, Ys, .(H, Ls))) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls))

The argument filtering Pi contains the following mapping:
mergesort_in_gaa(x1, x2, x3)  =  mergesort_in_gaa(x1)
[]  =  []
mergesort_out_gaa(x1, x2, x3)  =  mergesort_out_gaa(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U1_gaa(x1, x2, x3, x7)
split_in_gaaa(x1, x2, x3, x4)  =  split_in_gaaa(x1)
split_out_gaaa(x1, x2, x3, x4)  =  split_out_gaaa(x1, x2, x3)
U5_gaaa(x1, x2, x3, x4, x5, x6, x7)  =  U5_gaaa(x1, x2, x7)
U2_gaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U2_gaa(x1, x2, x3, x7, x8)
U3_gaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U3_gaa(x1, x2, x3, x7, x8)
U4_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U4_gaa(x1, x2, x3, x7)
merge_in_ggaa(x1, x2, x3, x4)  =  merge_in_ggaa(x1, x2)
merge_out_ggaa(x1, x2, x3, x4)  =  merge_out_ggaa(x1, x2, x3)
U6_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U6_ggaa(x1, x2, x3, x4, x8)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U7_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_ggaa(x1, x2, x3, x4, x8)
U8_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U8_ggaa(x1, x2, x3, x4, x8)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U9_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U9_ggaa(x1, x2, x3, x4, x8)
MERGE_IN_GGAA(x1, x2, x3, x4)  =  MERGE_IN_GGAA(x1, x2)
LE_IN_GG(x1, x2)  =  LE_IN_GG(x1, x2)
U6_GGAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U6_GGAA(x1, x2, x3, x4, x8)
U2_GAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U2_GAA(x1, x2, x3, x7, x8)
U1_GAA(x1, x2, x3, x4, x5, x6, x7)  =  U1_GAA(x1, x2, x3, x7)
SPLIT_IN_GAAA(x1, x2, x3, x4)  =  SPLIT_IN_GAAA(x1)
U3_GAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U3_GAA(x1, x2, x3, x7, x8)
U7_GGAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_GGAA(x1, x2, x3, x4, x8)
U9_GGAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U9_GGAA(x1, x2, x3, x4, x8)
U10_GG(x1, x2, x3)  =  U10_GG(x1, x2, x3)
MERGESORT_IN_GAA(x1, x2, x3)  =  MERGESORT_IN_GAA(x1)
U5_GAAA(x1, x2, x3, x4, x5, x6, x7)  =  U5_GAAA(x1, x2, x7)
U11_GG(x1, x2, x3)  =  U11_GG(x1, x2, x3)
U8_GGAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U8_GGAA(x1, x2, x3, x4, x8)
GT_IN_GG(x1, x2)  =  GT_IN_GG(x1, x2)
U4_GAA(x1, x2, x3, x4, x5, x6, x7)  =  U4_GAA(x1, x2, x3, x7)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

MERGESORT_IN_GAA(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_GAA(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
MERGESORT_IN_GAA(.(X, .(Y, Xs)), Ys, .(H, Ls)) → SPLIT_IN_GAAA(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))
SPLIT_IN_GAAA(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_GAAA(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
SPLIT_IN_GAAA(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → SPLIT_IN_GAAA(Xs, Zs, Ys, Ls)
U1_GAA(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_GAA(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U1_GAA(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → MERGESORT_IN_GAA(X1s, Y1s, Ls)
U2_GAA(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_GAA(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U2_GAA(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → MERGESORT_IN_GAA(X2s, Y2s, Ls)
U3_GAA(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_GAA(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
U3_GAA(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → MERGE_IN_GGAA(Y1s, Y2s, Ys, .(H, Ls))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_in_gg(X, Y))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → LE_IN_GG(X, Y)
LE_IN_GG(s(X), s(Y)) → U11_GG(X, Y, le_in_gg(X, Y))
LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)
U6_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_GGAA(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
U6_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → MERGE_IN_GGAA(Xs, .(Y, Ys), Zs, Ls)
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_in_gg(X, Y))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → GT_IN_GG(X, Y)
GT_IN_GG(s(X), s(Y)) → U10_GG(X, Y, gt_in_gg(X, Y))
GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)
U8_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_GGAA(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U8_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → MERGE_IN_GGAA(.(X, Xs), Ys, Zs, Ls)

The TRS R consists of the following rules:

mergesort_in_gaa([], [], Ls) → mergesort_out_gaa([], [], Ls)
mergesort_in_gaa(.(X, []), .(X, []), Ls) → mergesort_out_gaa(.(X, []), .(X, []), Ls)
mergesort_in_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_gaa(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
split_in_gaaa([], [], [], Ls) → split_out_gaaa([], [], [], Ls)
split_in_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_out_gaaa(Xs, Zs, Ys, Ls)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls))
U1_gaa(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_gaa(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
merge_in_ggaa([], Xs, Xs, Ls) → merge_out_ggaa([], Xs, Xs, Ls)
merge_in_ggaa(Xs, [], Xs, Ls) → merge_out_ggaa(Xs, [], Xs, Ls)
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(0)) → le_out_gg(0, s(0))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(.(X, Xs), Ys, Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls))
U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(Xs, .(Y, Ys), Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls))
U4_gaa(X, Y, Xs, Ys, H, Ls, merge_out_ggaa(Y1s, Y2s, Ys, .(H, Ls))) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls))

The argument filtering Pi contains the following mapping:
mergesort_in_gaa(x1, x2, x3)  =  mergesort_in_gaa(x1)
[]  =  []
mergesort_out_gaa(x1, x2, x3)  =  mergesort_out_gaa(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U1_gaa(x1, x2, x3, x7)
split_in_gaaa(x1, x2, x3, x4)  =  split_in_gaaa(x1)
split_out_gaaa(x1, x2, x3, x4)  =  split_out_gaaa(x1, x2, x3)
U5_gaaa(x1, x2, x3, x4, x5, x6, x7)  =  U5_gaaa(x1, x2, x7)
U2_gaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U2_gaa(x1, x2, x3, x7, x8)
U3_gaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U3_gaa(x1, x2, x3, x7, x8)
U4_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U4_gaa(x1, x2, x3, x7)
merge_in_ggaa(x1, x2, x3, x4)  =  merge_in_ggaa(x1, x2)
merge_out_ggaa(x1, x2, x3, x4)  =  merge_out_ggaa(x1, x2, x3)
U6_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U6_ggaa(x1, x2, x3, x4, x8)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U7_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_ggaa(x1, x2, x3, x4, x8)
U8_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U8_ggaa(x1, x2, x3, x4, x8)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U9_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U9_ggaa(x1, x2, x3, x4, x8)
MERGE_IN_GGAA(x1, x2, x3, x4)  =  MERGE_IN_GGAA(x1, x2)
LE_IN_GG(x1, x2)  =  LE_IN_GG(x1, x2)
U6_GGAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U6_GGAA(x1, x2, x3, x4, x8)
U2_GAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U2_GAA(x1, x2, x3, x7, x8)
U1_GAA(x1, x2, x3, x4, x5, x6, x7)  =  U1_GAA(x1, x2, x3, x7)
SPLIT_IN_GAAA(x1, x2, x3, x4)  =  SPLIT_IN_GAAA(x1)
U3_GAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U3_GAA(x1, x2, x3, x7, x8)
U7_GGAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_GGAA(x1, x2, x3, x4, x8)
U9_GGAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U9_GGAA(x1, x2, x3, x4, x8)
U10_GG(x1, x2, x3)  =  U10_GG(x1, x2, x3)
MERGESORT_IN_GAA(x1, x2, x3)  =  MERGESORT_IN_GAA(x1)
U5_GAAA(x1, x2, x3, x4, x5, x6, x7)  =  U5_GAAA(x1, x2, x7)
U11_GG(x1, x2, x3)  =  U11_GG(x1, x2, x3)
U8_GGAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U8_GGAA(x1, x2, x3, x4, x8)
GT_IN_GG(x1, x2)  =  GT_IN_GG(x1, x2)
U4_GAA(x1, x2, x3, x4, x5, x6, x7)  =  U4_GAA(x1, x2, x3, x7)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 5 SCCs with 11 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)

The TRS R consists of the following rules:

mergesort_in_gaa([], [], Ls) → mergesort_out_gaa([], [], Ls)
mergesort_in_gaa(.(X, []), .(X, []), Ls) → mergesort_out_gaa(.(X, []), .(X, []), Ls)
mergesort_in_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_gaa(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
split_in_gaaa([], [], [], Ls) → split_out_gaaa([], [], [], Ls)
split_in_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_out_gaaa(Xs, Zs, Ys, Ls)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls))
U1_gaa(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_gaa(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
merge_in_ggaa([], Xs, Xs, Ls) → merge_out_ggaa([], Xs, Xs, Ls)
merge_in_ggaa(Xs, [], Xs, Ls) → merge_out_ggaa(Xs, [], Xs, Ls)
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(0)) → le_out_gg(0, s(0))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(.(X, Xs), Ys, Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls))
U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(Xs, .(Y, Ys), Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls))
U4_gaa(X, Y, Xs, Ys, H, Ls, merge_out_ggaa(Y1s, Y2s, Ys, .(H, Ls))) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls))

The argument filtering Pi contains the following mapping:
mergesort_in_gaa(x1, x2, x3)  =  mergesort_in_gaa(x1)
[]  =  []
mergesort_out_gaa(x1, x2, x3)  =  mergesort_out_gaa(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U1_gaa(x1, x2, x3, x7)
split_in_gaaa(x1, x2, x3, x4)  =  split_in_gaaa(x1)
split_out_gaaa(x1, x2, x3, x4)  =  split_out_gaaa(x1, x2, x3)
U5_gaaa(x1, x2, x3, x4, x5, x6, x7)  =  U5_gaaa(x1, x2, x7)
U2_gaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U2_gaa(x1, x2, x3, x7, x8)
U3_gaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U3_gaa(x1, x2, x3, x7, x8)
U4_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U4_gaa(x1, x2, x3, x7)
merge_in_ggaa(x1, x2, x3, x4)  =  merge_in_ggaa(x1, x2)
merge_out_ggaa(x1, x2, x3, x4)  =  merge_out_ggaa(x1, x2, x3)
U6_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U6_ggaa(x1, x2, x3, x4, x8)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U7_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_ggaa(x1, x2, x3, x4, x8)
U8_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U8_ggaa(x1, x2, x3, x4, x8)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U9_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U9_ggaa(x1, x2, x3, x4, x8)
GT_IN_GG(x1, x2)  =  GT_IN_GG(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

GT_IN_GG(s(X), s(Y)) → GT_IN_GG(X, Y)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)

The TRS R consists of the following rules:

mergesort_in_gaa([], [], Ls) → mergesort_out_gaa([], [], Ls)
mergesort_in_gaa(.(X, []), .(X, []), Ls) → mergesort_out_gaa(.(X, []), .(X, []), Ls)
mergesort_in_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_gaa(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
split_in_gaaa([], [], [], Ls) → split_out_gaaa([], [], [], Ls)
split_in_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_out_gaaa(Xs, Zs, Ys, Ls)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls))
U1_gaa(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_gaa(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
merge_in_ggaa([], Xs, Xs, Ls) → merge_out_ggaa([], Xs, Xs, Ls)
merge_in_ggaa(Xs, [], Xs, Ls) → merge_out_ggaa(Xs, [], Xs, Ls)
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(0)) → le_out_gg(0, s(0))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(.(X, Xs), Ys, Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls))
U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(Xs, .(Y, Ys), Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls))
U4_gaa(X, Y, Xs, Ys, H, Ls, merge_out_ggaa(Y1s, Y2s, Ys, .(H, Ls))) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls))

The argument filtering Pi contains the following mapping:
mergesort_in_gaa(x1, x2, x3)  =  mergesort_in_gaa(x1)
[]  =  []
mergesort_out_gaa(x1, x2, x3)  =  mergesort_out_gaa(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U1_gaa(x1, x2, x3, x7)
split_in_gaaa(x1, x2, x3, x4)  =  split_in_gaaa(x1)
split_out_gaaa(x1, x2, x3, x4)  =  split_out_gaaa(x1, x2, x3)
U5_gaaa(x1, x2, x3, x4, x5, x6, x7)  =  U5_gaaa(x1, x2, x7)
U2_gaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U2_gaa(x1, x2, x3, x7, x8)
U3_gaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U3_gaa(x1, x2, x3, x7, x8)
U4_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U4_gaa(x1, x2, x3, x7)
merge_in_ggaa(x1, x2, x3, x4)  =  merge_in_ggaa(x1, x2)
merge_out_ggaa(x1, x2, x3, x4)  =  merge_out_ggaa(x1, x2, x3)
U6_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U6_ggaa(x1, x2, x3, x4, x8)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U7_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_ggaa(x1, x2, x3, x4, x8)
U8_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U8_ggaa(x1, x2, x3, x4, x8)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U9_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U9_ggaa(x1, x2, x3, x4, x8)
LE_IN_GG(x1, x2)  =  LE_IN_GG(x1, x2)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)

R is empty.
Pi is empty.
We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

LE_IN_GG(s(X), s(Y)) → LE_IN_GG(X, Y)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

U8_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → MERGE_IN_GGAA(.(X, Xs), Ys, Zs, Ls)
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_in_gg(X, Y))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_in_gg(X, Y))
U6_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → MERGE_IN_GGAA(Xs, .(Y, Ys), Zs, Ls)

The TRS R consists of the following rules:

mergesort_in_gaa([], [], Ls) → mergesort_out_gaa([], [], Ls)
mergesort_in_gaa(.(X, []), .(X, []), Ls) → mergesort_out_gaa(.(X, []), .(X, []), Ls)
mergesort_in_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_gaa(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
split_in_gaaa([], [], [], Ls) → split_out_gaaa([], [], [], Ls)
split_in_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_out_gaaa(Xs, Zs, Ys, Ls)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls))
U1_gaa(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_gaa(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
merge_in_ggaa([], Xs, Xs, Ls) → merge_out_ggaa([], Xs, Xs, Ls)
merge_in_ggaa(Xs, [], Xs, Ls) → merge_out_ggaa(Xs, [], Xs, Ls)
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(0)) → le_out_gg(0, s(0))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(.(X, Xs), Ys, Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls))
U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(Xs, .(Y, Ys), Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls))
U4_gaa(X, Y, Xs, Ys, H, Ls, merge_out_ggaa(Y1s, Y2s, Ys, .(H, Ls))) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls))

The argument filtering Pi contains the following mapping:
mergesort_in_gaa(x1, x2, x3)  =  mergesort_in_gaa(x1)
[]  =  []
mergesort_out_gaa(x1, x2, x3)  =  mergesort_out_gaa(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U1_gaa(x1, x2, x3, x7)
split_in_gaaa(x1, x2, x3, x4)  =  split_in_gaaa(x1)
split_out_gaaa(x1, x2, x3, x4)  =  split_out_gaaa(x1, x2, x3)
U5_gaaa(x1, x2, x3, x4, x5, x6, x7)  =  U5_gaaa(x1, x2, x7)
U2_gaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U2_gaa(x1, x2, x3, x7, x8)
U3_gaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U3_gaa(x1, x2, x3, x7, x8)
U4_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U4_gaa(x1, x2, x3, x7)
merge_in_ggaa(x1, x2, x3, x4)  =  merge_in_ggaa(x1, x2)
merge_out_ggaa(x1, x2, x3, x4)  =  merge_out_ggaa(x1, x2, x3)
U6_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U6_ggaa(x1, x2, x3, x4, x8)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U7_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_ggaa(x1, x2, x3, x4, x8)
U8_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U8_ggaa(x1, x2, x3, x4, x8)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U9_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U9_ggaa(x1, x2, x3, x4, x8)
MERGE_IN_GGAA(x1, x2, x3, x4)  =  MERGE_IN_GGAA(x1, x2)
U6_GGAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U6_GGAA(x1, x2, x3, x4, x8)
U8_GGAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U8_GGAA(x1, x2, x3, x4, x8)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

U8_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → MERGE_IN_GGAA(.(X, Xs), Ys, Zs, Ls)
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_in_gg(X, Y))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_GGAA(X, Xs, Y, Ys, Zs, H, Ls, gt_in_gg(X, Y))
U6_GGAA(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → MERGE_IN_GGAA(Xs, .(Y, Ys), Zs, Ls)

The TRS R consists of the following rules:

le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(0)) → le_out_gg(0, s(0))
le_in_gg(0, 0) → le_out_gg(0, 0)
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(0), 0) → gt_out_gg(s(0), 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))

The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
MERGE_IN_GGAA(x1, x2, x3, x4)  =  MERGE_IN_GGAA(x1, x2)
U6_GGAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U6_GGAA(x1, x2, x3, x4, x8)
U8_GGAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U8_GGAA(x1, x2, x3, x4, x8)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ RuleRemovalProof
              ↳ PiDP
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

MERGE_IN_GGAA(.(X, Xs), .(Y, Ys)) → U8_GGAA(X, Xs, Y, Ys, gt_in_gg(X, Y))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys)) → U6_GGAA(X, Xs, Y, Ys, le_in_gg(X, Y))
U6_GGAA(X, Xs, Y, Ys, le_out_gg(X, Y)) → MERGE_IN_GGAA(Xs, .(Y, Ys))
U8_GGAA(X, Xs, Y, Ys, gt_out_gg(X, Y)) → MERGE_IN_GGAA(.(X, Xs), Ys)

The TRS R consists of the following rules:

le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(0)) → le_out_gg(0, s(0))
le_in_gg(0, 0) → le_out_gg(0, 0)
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(0), 0) → gt_out_gg(s(0), 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))

The set Q consists of the following terms:

le_in_gg(x0, x1)
gt_in_gg(x0, x1)
U11_gg(x0, x1, x2)
U10_gg(x0, x1, x2)

We have to consider all (P,Q,R)-chains.
By using the rule removal processor [15] with the following polynomial ordering [25], at least one Dependency Pair or term rewrite system rule of this QDP problem can be strictly oriented.
Strictly oriented dependency pairs:

MERGE_IN_GGAA(.(X, Xs), .(Y, Ys)) → U8_GGAA(X, Xs, Y, Ys, gt_in_gg(X, Y))
MERGE_IN_GGAA(.(X, Xs), .(Y, Ys)) → U6_GGAA(X, Xs, Y, Ys, le_in_gg(X, Y))
U6_GGAA(X, Xs, Y, Ys, le_out_gg(X, Y)) → MERGE_IN_GGAA(Xs, .(Y, Ys))


Used ordering: POLO with Polynomial interpretation [25]:

POL(.(x1, x2)) = 1 + 2·x1 + x2   
POL(0) = 0   
POL(MERGE_IN_GGAA(x1, x2)) = 2·x1 + 2·x2   
POL(U10_gg(x1, x2, x3)) = x1 + x2 + x3   
POL(U11_gg(x1, x2, x3)) = x1 + x2 + x3   
POL(U6_GGAA(x1, x2, x3, x4, x5)) = 1 + x1 + 2·x2 + 2·x3 + 2·x4 + 2·x5   
POL(U8_GGAA(x1, x2, x3, x4, x5)) = 2 + 2·x1 + 2·x2 + 2·x3 + 2·x4 + 2·x5   
POL(gt_in_gg(x1, x2)) = x1 + x2   
POL(gt_out_gg(x1, x2)) = x1 + x2   
POL(le_in_gg(x1, x2)) = 1 + x1 + x2   
POL(le_out_gg(x1, x2)) = 1 + x1 + x2   
POL(s(x1)) = 2·x1   



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
                      ↳ QDP
                        ↳ RuleRemovalProof
QDP
                            ↳ DependencyGraphProof
              ↳ PiDP
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

U8_GGAA(X, Xs, Y, Ys, gt_out_gg(X, Y)) → MERGE_IN_GGAA(.(X, Xs), Ys)

The TRS R consists of the following rules:

le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(0)) → le_out_gg(0, s(0))
le_in_gg(0, 0) → le_out_gg(0, 0)
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(0), 0) → gt_out_gg(s(0), 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))

The set Q consists of the following terms:

le_in_gg(x0, x1)
gt_in_gg(x0, x1)
U11_gg(x0, x1, x2)
U10_gg(x0, x1, x2)

We have to consider all (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 0 SCCs with 1 less node.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ UsableRulesProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

SPLIT_IN_GAAA(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → SPLIT_IN_GAAA(Xs, Zs, Ys, Ls)

The TRS R consists of the following rules:

mergesort_in_gaa([], [], Ls) → mergesort_out_gaa([], [], Ls)
mergesort_in_gaa(.(X, []), .(X, []), Ls) → mergesort_out_gaa(.(X, []), .(X, []), Ls)
mergesort_in_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_gaa(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
split_in_gaaa([], [], [], Ls) → split_out_gaaa([], [], [], Ls)
split_in_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_out_gaaa(Xs, Zs, Ys, Ls)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls))
U1_gaa(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_gaa(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
merge_in_ggaa([], Xs, Xs, Ls) → merge_out_ggaa([], Xs, Xs, Ls)
merge_in_ggaa(Xs, [], Xs, Ls) → merge_out_ggaa(Xs, [], Xs, Ls)
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(0)) → le_out_gg(0, s(0))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(.(X, Xs), Ys, Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls))
U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(Xs, .(Y, Ys), Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls))
U4_gaa(X, Y, Xs, Ys, H, Ls, merge_out_ggaa(Y1s, Y2s, Ys, .(H, Ls))) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls))

The argument filtering Pi contains the following mapping:
mergesort_in_gaa(x1, x2, x3)  =  mergesort_in_gaa(x1)
[]  =  []
mergesort_out_gaa(x1, x2, x3)  =  mergesort_out_gaa(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U1_gaa(x1, x2, x3, x7)
split_in_gaaa(x1, x2, x3, x4)  =  split_in_gaaa(x1)
split_out_gaaa(x1, x2, x3, x4)  =  split_out_gaaa(x1, x2, x3)
U5_gaaa(x1, x2, x3, x4, x5, x6, x7)  =  U5_gaaa(x1, x2, x7)
U2_gaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U2_gaa(x1, x2, x3, x7, x8)
U3_gaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U3_gaa(x1, x2, x3, x7, x8)
U4_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U4_gaa(x1, x2, x3, x7)
merge_in_ggaa(x1, x2, x3, x4)  =  merge_in_ggaa(x1, x2)
merge_out_ggaa(x1, x2, x3, x4)  =  merge_out_ggaa(x1, x2, x3)
U6_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U6_ggaa(x1, x2, x3, x4, x8)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U7_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_ggaa(x1, x2, x3, x4, x8)
U8_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U8_ggaa(x1, x2, x3, x4, x8)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U9_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U9_ggaa(x1, x2, x3, x4, x8)
SPLIT_IN_GAAA(x1, x2, x3, x4)  =  SPLIT_IN_GAAA(x1)

We have to consider all (P,R,Pi)-chains
For (infinitary) constructor rewriting [30] we can delete all non-usable rules from R.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
PiDP
                    ↳ PiDPToQDPProof
              ↳ PiDP

Pi DP problem:
The TRS P consists of the following rules:

SPLIT_IN_GAAA(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → SPLIT_IN_GAAA(Xs, Zs, Ys, Ls)

R is empty.
The argument filtering Pi contains the following mapping:
.(x1, x2)  =  .(x1, x2)
SPLIT_IN_GAAA(x1, x2, x3, x4)  =  SPLIT_IN_GAAA(x1)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ UsableRulesProof
                  ↳ PiDP
                    ↳ PiDPToQDPProof
QDP
                        ↳ QDPSizeChangeProof
              ↳ PiDP

Q DP problem:
The TRS P consists of the following rules:

SPLIT_IN_GAAA(.(X, Xs)) → SPLIT_IN_GAAA(Xs)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
PiDP
                ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

MERGESORT_IN_GAA(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_GAA(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
U1_GAA(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_GAA(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_GAA(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → MERGESORT_IN_GAA(X2s, Y2s, Ls)
U1_GAA(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → MERGESORT_IN_GAA(X1s, Y1s, Ls)

The TRS R consists of the following rules:

mergesort_in_gaa([], [], Ls) → mergesort_out_gaa([], [], Ls)
mergesort_in_gaa(.(X, []), .(X, []), Ls) → mergesort_out_gaa(.(X, []), .(X, []), Ls)
mergesort_in_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls)) → U1_gaa(X, Y, Xs, Ys, H, Ls, split_in_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls)))
split_in_gaaa([], [], [], Ls) → split_out_gaaa([], [], [], Ls)
split_in_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls)) → U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_in_gaaa(Xs, Zs, Ys, Ls))
U5_gaaa(X, Xs, Ys, Zs, H, Ls, split_out_gaaa(Xs, Zs, Ys, Ls)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs, .(H, Ls))
U1_gaa(X, Y, Xs, Ys, H, Ls, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s, .(H, Ls))) → U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_in_gaa(X1s, Y1s, Ls))
U2_gaa(X, Y, Xs, Ys, H, Ls, X2s, mergesort_out_gaa(X1s, Y1s, Ls)) → U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_in_gaa(X2s, Y2s, Ls))
U3_gaa(X, Y, Xs, Ys, H, Ls, Y1s, mergesort_out_gaa(X2s, Y2s, Ls)) → U4_gaa(X, Y, Xs, Ys, H, Ls, merge_in_ggaa(Y1s, Y2s, Ys, .(H, Ls)))
merge_in_ggaa([], Xs, Xs, Ls) → merge_out_ggaa([], Xs, Xs, Ls)
merge_in_ggaa(Xs, [], Xs, Ls) → merge_out_ggaa(Xs, [], Xs, Ls)
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls)) → U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(0)) → le_out_gg(0, s(0))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_ggaa(X, Xs, Y, Ys, Zs, H, Ls, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(Xs, .(Y, Ys), Zs, Ls))
merge_in_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls)) → U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, Zs, H, Ls, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_in_ggaa(.(X, Xs), Ys, Zs, Ls))
U9_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(.(X, Xs), Ys, Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs), .(H, Ls))
U7_ggaa(X, Xs, Y, Ys, Zs, H, Ls, merge_out_ggaa(Xs, .(Y, Ys), Zs, Ls)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs), .(H, Ls))
U4_gaa(X, Y, Xs, Ys, H, Ls, merge_out_ggaa(Y1s, Y2s, Ys, .(H, Ls))) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys, .(H, Ls))

The argument filtering Pi contains the following mapping:
mergesort_in_gaa(x1, x2, x3)  =  mergesort_in_gaa(x1)
[]  =  []
mergesort_out_gaa(x1, x2, x3)  =  mergesort_out_gaa(x1, x2)
.(x1, x2)  =  .(x1, x2)
U1_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U1_gaa(x1, x2, x3, x7)
split_in_gaaa(x1, x2, x3, x4)  =  split_in_gaaa(x1)
split_out_gaaa(x1, x2, x3, x4)  =  split_out_gaaa(x1, x2, x3)
U5_gaaa(x1, x2, x3, x4, x5, x6, x7)  =  U5_gaaa(x1, x2, x7)
U2_gaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U2_gaa(x1, x2, x3, x7, x8)
U3_gaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U3_gaa(x1, x2, x3, x7, x8)
U4_gaa(x1, x2, x3, x4, x5, x6, x7)  =  U4_gaa(x1, x2, x3, x7)
merge_in_ggaa(x1, x2, x3, x4)  =  merge_in_ggaa(x1, x2)
merge_out_ggaa(x1, x2, x3, x4)  =  merge_out_ggaa(x1, x2, x3)
U6_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U6_ggaa(x1, x2, x3, x4, x8)
le_in_gg(x1, x2)  =  le_in_gg(x1, x2)
s(x1)  =  s(x1)
U11_gg(x1, x2, x3)  =  U11_gg(x1, x2, x3)
0  =  0
le_out_gg(x1, x2)  =  le_out_gg(x1, x2)
U7_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U7_ggaa(x1, x2, x3, x4, x8)
U8_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U8_ggaa(x1, x2, x3, x4, x8)
gt_in_gg(x1, x2)  =  gt_in_gg(x1, x2)
U10_gg(x1, x2, x3)  =  U10_gg(x1, x2, x3)
gt_out_gg(x1, x2)  =  gt_out_gg(x1, x2)
U9_ggaa(x1, x2, x3, x4, x5, x6, x7, x8)  =  U9_ggaa(x1, x2, x3, x4, x8)
U2_GAA(x1, x2, x3, x4, x5, x6, x7, x8)  =  U2_GAA(x1, x2, x3, x7, x8)
U1_GAA(x1, x2, x3, x4, x5, x6, x7)  =  U1_GAA(x1, x2, x3, x7)
MERGESORT_IN_GAA(x1, x2, x3)  =  MERGESORT_IN_GAA(x1)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
              ↳ PiDP
                ↳ PiDPToQDPProof
QDP

Q DP problem:
The TRS P consists of the following rules:

U2_GAA(X, Y, Xs, X2s, mergesort_out_gaa(X1s, Y1s)) → MERGESORT_IN_GAA(X2s)
U1_GAA(X, Y, Xs, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_GAA(X, Y, Xs, X2s, mergesort_in_gaa(X1s))
MERGESORT_IN_GAA(.(X, .(Y, Xs))) → U1_GAA(X, Y, Xs, split_in_gaaa(.(X, .(Y, Xs))))
U1_GAA(X, Y, Xs, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s)) → MERGESORT_IN_GAA(X1s)

The TRS R consists of the following rules:

mergesort_in_gaa([]) → mergesort_out_gaa([], [])
mergesort_in_gaa(.(X, [])) → mergesort_out_gaa(.(X, []), .(X, []))
mergesort_in_gaa(.(X, .(Y, Xs))) → U1_gaa(X, Y, Xs, split_in_gaaa(.(X, .(Y, Xs))))
split_in_gaaa([]) → split_out_gaaa([], [], [])
split_in_gaaa(.(X, Xs)) → U5_gaaa(X, Xs, split_in_gaaa(Xs))
U5_gaaa(X, Xs, split_out_gaaa(Xs, Zs, Ys)) → split_out_gaaa(.(X, Xs), .(X, Ys), Zs)
U1_gaa(X, Y, Xs, split_out_gaaa(.(X, .(Y, Xs)), X1s, X2s)) → U2_gaa(X, Y, Xs, X2s, mergesort_in_gaa(X1s))
U2_gaa(X, Y, Xs, X2s, mergesort_out_gaa(X1s, Y1s)) → U3_gaa(X, Y, Xs, Y1s, mergesort_in_gaa(X2s))
U3_gaa(X, Y, Xs, Y1s, mergesort_out_gaa(X2s, Y2s)) → U4_gaa(X, Y, Xs, merge_in_ggaa(Y1s, Y2s))
merge_in_ggaa([], Xs) → merge_out_ggaa([], Xs, Xs)
merge_in_ggaa(Xs, []) → merge_out_ggaa(Xs, [], Xs)
merge_in_ggaa(.(X, Xs), .(Y, Ys)) → U6_ggaa(X, Xs, Y, Ys, le_in_gg(X, Y))
le_in_gg(s(X), s(Y)) → U11_gg(X, Y, le_in_gg(X, Y))
le_in_gg(0, s(0)) → le_out_gg(0, s(0))
le_in_gg(0, 0) → le_out_gg(0, 0)
U11_gg(X, Y, le_out_gg(X, Y)) → le_out_gg(s(X), s(Y))
U6_ggaa(X, Xs, Y, Ys, le_out_gg(X, Y)) → U7_ggaa(X, Xs, Y, Ys, merge_in_ggaa(Xs, .(Y, Ys)))
merge_in_ggaa(.(X, Xs), .(Y, Ys)) → U8_ggaa(X, Xs, Y, Ys, gt_in_gg(X, Y))
gt_in_gg(s(X), s(Y)) → U10_gg(X, Y, gt_in_gg(X, Y))
gt_in_gg(s(0), 0) → gt_out_gg(s(0), 0)
U10_gg(X, Y, gt_out_gg(X, Y)) → gt_out_gg(s(X), s(Y))
U8_ggaa(X, Xs, Y, Ys, gt_out_gg(X, Y)) → U9_ggaa(X, Xs, Y, Ys, merge_in_ggaa(.(X, Xs), Ys))
U9_ggaa(X, Xs, Y, Ys, merge_out_ggaa(.(X, Xs), Ys, Zs)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(Y, Zs))
U7_ggaa(X, Xs, Y, Ys, merge_out_ggaa(Xs, .(Y, Ys), Zs)) → merge_out_ggaa(.(X, Xs), .(Y, Ys), .(X, Zs))
U4_gaa(X, Y, Xs, merge_out_ggaa(Y1s, Y2s, Ys)) → mergesort_out_gaa(.(X, .(Y, Xs)), Ys)

The set Q consists of the following terms:

mergesort_in_gaa(x0)
split_in_gaaa(x0)
U5_gaaa(x0, x1, x2)
U1_gaa(x0, x1, x2, x3)
U2_gaa(x0, x1, x2, x3, x4)
U3_gaa(x0, x1, x2, x3, x4)
merge_in_ggaa(x0, x1)
le_in_gg(x0, x1)
U11_gg(x0, x1, x2)
U6_ggaa(x0, x1, x2, x3, x4)
gt_in_gg(x0, x1)
U10_gg(x0, x1, x2)
U8_ggaa(x0, x1, x2, x3, x4)
U9_ggaa(x0, x1, x2, x3, x4)
U7_ggaa(x0, x1, x2, x3, x4)
U4_gaa(x0, x1, x2, x3)

We have to consider all (P,Q,R)-chains.